You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> `IT is made using React and basic linked list functionalites.`
3
+
> ## _It is a snake game made using React and basic linked list functionalities._
4
4
5
+
The entire game consists of the following three main components: Game Board, Snake, and Food Cells.
5
6
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
0 commit comments