Finally I made it. Here is my first game for the Arduboy. Below is a video of the gameplay. Its probably very tough to play but who knows… maybe I am just too slow. The help screen explains most of it but here is the short story:
A : throw at the upper lane
B : throw at the lower lane
Left, Right : move the player (the guy on top of the screen)
Up, Down : change weapon
Up + A : pause
Weapons are:
water bomp : low damage but fast fire rate
poo : high damage but low fire rate
oil : low damage but slows down enemies, medium cooldown
molotov : high area damage, slow cooldown
Do not hit grandma an the little girl. They will draw score if you do so.
The code is a mess but I learned a lot. Especially that I need to think about what I want to do in advance and plan the game properly.
I used platformio to flash it to the Arduboy. This is dangerous if the sketch is too big and you are using platformio before version 2.10.0. If you want to use platformio with an old version then take care the limit of 28672 bytes for the flash are not exceeded. Especially when you modify Fatsche.
The code of Fatsche is here:
If you want to compile it in the Arduino IDE you need to copy all the source files into a sketch folder named Fatsche.
Due to some leonardo bootloader issue you need to follow the following procedure to flash again (any sketch):
- hold UP button
- switch on the Arduboy
- release UP button
- now you can flash your sketch
For people who are looking for some compression code, I have also added some compression to this game which worked quite nice. In the graphics folder there is a python script that does the compression and inside VeritazzExtra.cpp there is the code to uncompress it again. It save me a lot of kb. In this particular case of my graphics it was:
total image data = 12600 bytes
total image data packed = 8411 bytes (66%)
The script is not very pythonic and there is a little issue when printing the ascii image of image masks but it works and has no issue that affects the functionality for image conversion and compression.
Enjoy it.