Why don't you try your own solution?
Rather than looking at someone else's code, and trying to do basically the same thing over again.
Snake:
- snake moves every 'tick' (ticks get quicker as the game progresses)
- snake hits wall - dead
- snake hits snake - dead
- player presses key - snake changes direction
- snake hits food - snake gets longer
That's pretty much all there is to it.
> do I need to know about: structures? array? etc.
Yes.
Or rather, your life will be a lot easier with careful use of these things.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
> How do I bind the up/down/left/right keys?
That depends on your OS/Compiler/Kind of program.
A Linux Console program has a different answer to a windows GUI program.
Yeah, it's just a loop with some inputs.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953