Fatsche: defend the door!

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.


Fantastic animations!! Good job!

1 Like

Haha, generally when you make a game you find it much easier than everyone else does, so if you find this hard then imagine how hard other people will find it! :smile: I haven’t played it yet, but it’ll be worth getting someone else to play it and see how they go, and then tweak the difficulty a bit.

The graphics look really good, from what I can see!

1 Like

Thank you very much. Actually I am not an artist and the graphics took me ages. Nice to hear you enjoy them.
For the difficulty I think I need to reduce the life of the boss. It seems it is pretty tough to beat him. I’ll try to update it this evening.

Anyone had the chance to check the compilation issue in the Arduino IDE? I used 1.6.9. I am still lost here as I am blind on my own code to find the issue :confused:. I think for most people it would be nice to be able to compile it with the Arduino IDE :heart_eyes:

1 Like

I have now pushed some changes that make the code compile in Arduino IDE 1.6.9. Unfortunately it cannot flash the image to the Arduboy for some reason.
I have updated now to platformio 2.10.1 and it works like charm. No issue with the image size anymore.
When you want to flash a new version of Fatsche then hold the UP button when switching on the Arduboy. Then run:

platformio run --target upload

and enjoy the game.

If anyone knows why the Arduino IDE cannot flash the image, please let me know.

If you’re going to create your own version of the Arduboy library, could you please rename the files and classes so it doesn’t conflict with having the official library installed. Otherwise, include your custom version of the library in the Fatsche folder along with your sketch, instead of installing it separately in the libraries folder.

@MLXXXp Ah yes you are right. I’ll do it asap. Actually I think my version is not different from the upstream one. Mostly I did this for my host tests and to ensure the size of the image does not vary. Currently Fatsche is almost at the edge of the allowed image size and with my own version of the library I can make sure that changes to the Arduboy library will not cause issues to for users that have different versions of this library.

I think I will paste everything together in one lib just for this game.

1 Like

Another really great looking and fun-to-play game for the Arduboy - well done!

1 Like

@MrVectrex Many thanks. Glad you can enjoy it.

@MLXXXp I now removed the dependency to my own library and move all the required code into the Fatsche repository. This makes it also easier to import the code into the Arduino IDE. For some reason the image is even a little smaller now. :sweat_smile:

1 Like

I can’t get this off of my Arduboy. I try to upload a new game but Fatsche is still there. I’ve tried resetting while uploading a new code, nothing works. Any tips on how to fix this? Is anyone else having the same problem?

The game is using almost all RAM and that causes some issue with the caterina bootloader. You need to do the following:

  • switch off the Arduboy
  • press and hold the UP button
  • switch on the Arduboy
  • release the UP button
  • now upload your new sketch

Here is some more information (the thread is quite big, but essentially the flashlight mode (hold the UP button during boot) is the solution.


1 Like

Awesome, just tried it and it worked. I was thinking that with the amount of RAM it was taking up it left no room for being overwritten, but that’s why I’m not a programmer. Thanks, @veritazz. And on a game-related note, played it several times over the course of two days. I love the challenge of it.

Glad you enjoyed it. :sweat_smile:
Yeah the bootloader is quite strange. I do not know why they did put a magic value in the middle of the RAM (0x800). Feels like they did it for some other AVR with less RAM. Anyway, hopefully in the future we will find either a solution or flash an updated bootloader.