americast / Snakes

A simple game of snakes implemented in C++ and OpenCV
GNU General Public License v3.0
25 stars 39 forks source link

Add walls #3

Open americast opened 6 years ago

americast commented 6 years ago

Add walls in between. Implementation depends on the one who sends the PRs. One may increase the wall with levels or create a separate game mode with walls.

rishabhdeepsingh commented 6 years ago

Are these suppose to be random walls in the space?

hrshbh commented 6 years ago

Random walls can create a few problems like:
1) Food/Snake is fully enclosed by walls.
2) Wall appearing few pixels in front of snake, not giving the player enough time to react.

So, I think you have to predetermine the position and size of walls, in whatever way you are implementing. :-)

americast commented 6 years ago

As per your wish @rishabhdeepsingh. As @hrishabh23 mentioned, just make sure the food, whose location is randomly generated is no situated over the walls. Also, you can restrict the area where there can be a wall so that the snake does not collide into them just at the beginning of the game.

rishabhdeepsingh commented 6 years ago

@americast @hrishabh23 Let's say we are on Score 100 and our Snake is soo Large to Handle and there comes a wall in between so we have nothing to do instead of killing our self :(

americast commented 6 years ago

@rishabhdeepsingh Well, in that way, for some value of score, you might end up covering the entire window and have to kill yourself! :stuck_out_tongue:

prashantramnani commented 5 years ago

As a part of kwoc, I would like to work on this issue.