Skip to content

Commit ae3222b

Browse files
committed
Merge branch 'main' of https://github.com/swift1719/snakeGame into main
2 parents bb7afe0 + ec5d742 commit ae3222b

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

README.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
1-
> # Snake Game
1+
> # Snake Quest
22
3-
> `IT is made using React and basic linked list functionalites.`
3+
> ## _It is a snake game made using React and basic linked list functionalities._
44
5+
The entire game consists of the following three main components: Game Board, Snake, and Food Cells.
56

7+
The game is created around the following points:
8+
1. Create the Game Board using a Matrix
9+
1. Each cell in-board is identified using a unique id
10+
1. Snake is handled using a Singly Linked List
11+
1. Food is randomly generated using a utility function.
12+
1. Initializing snake movement and food cell
13+
1. Handling snake movements through arrow keys by attaching an event listener to the board
14+
1. Whenever a snake consumes food, then handling the growth of snake.There are two kinds of food available to a snake, an apple or a frog.
15+
- In the case of an apple, the snake will consume it and grow in size by one cell. The score will be incremented by one.
16+
- In the case of a frog, the snake will consume it and grow in size by one cell. And the score will be incremented by two. Also, the snake will reverse its direction.
17+
1. If the snake collides with itself or the boundary of the board then the game is over
18+
1. Displaying score
19+
1. Reset when game is over

0 commit comments

Comments
 (0)