Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Food Generation to Avoid Overlapping with Snake Body #9

Open
ANKITy102 opened this issue Mar 14, 2024 · 0 comments
Open

Improve Food Generation to Avoid Overlapping with Snake Body #9

ANKITy102 opened this issue Mar 14, 2024 · 0 comments
Labels
bug Something isn't working foss-weekend medium

Comments

@ANKITy102
Copy link
Contributor

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:

  • Revise the food generation logic to prevent food from appearing on the snake's body.
  • Implement checks to verify the validity of potential food positions before spawning food.
  • Ensure that the food generation mechanism maintains randomness while avoiding overlap with the snake's body.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working foss-weekend medium
Projects
None yet
Development

No branches or pull requests

1 participant