We can now show something on the screen. Lets write the game
-> You can find the game logic in the main.c
The game logic itself is pretty much straight forward but with one twist:
For the playing field every LED is numbered (0-63, bottom left = 0, top right =63) and every LED got an signed integer. (so its a 64Byte array)
This way the head position of each player is just a number instead of coordinates.
Moving up = position +8, down -8, left -1, right +1
Also the reason to use a signed integer:
Positive value = Player 1
Negative value = Player 2
-> Storing both players in one Array saving some data.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.