iiitl / snake-game-js

0 stars 43 forks source link

Improve Food Generation to Avoid Overlapping with Snake Body #9

Open ANKITy102 opened 5 months ago

ANKITy102 commented 5 months ago

Description:

Currently, food in the Snake game is generated at random positions on the game board. However, this can lead to situations where the food appears on the snake's body. To enhance gameplay fairness and avoid such occurrences, implement a mechanism to ensure that food is generated at positions where it does not overlap with the snake's body.

Tasks:

Resolution:

Solve the tasks outlined above and submit a pull request referencing this issue ID (#ISSUE_ID) with a demonstration of the improved food generation mechanism, ensuring that food does not overlap with the snake's body during gameplay.