My daughter Zaza wanted to know what this programming thing was all about, so we are sloooooowly making a snake game.
- Our steps, in rough order:
making green and red DIVs appear on the screen.- manually controlling their positions with styles
- creating random numbers to feed into the apple position. Explaining basic variables and functions.
- writing that as a function we can call
- getting a keypress. Using that to make the snake move once.
- Explaining how to check if the snake and the apple are in the same position. explain IF/THEN/ELSE.
- What do we do if the snake hits a border?
- I'll write more if she's still paying attention at this point. 😀
I'm a snake!
I'm an apple!