I4arduboy - A Shmup with Long-range Sniping



i4arduboy is a horizontal shmup. Control a submarine and snipe far enemies on off-screen with torpedos!
This is a porting from our windows work “i-20000.”



  • Weapons: you can use guns and topedoes in order to defeat enemies.
    • Guns fire automatically. You can destroy small enemies with them.
    • Torpedoes are launched when you push A or B button. This is the only way to defeat big enemies.
    • Only one torpedo can be launch at a time.
  • Game Field: there is the invisible area in game field.
    • Enemies may exist as far out as two screens away from the screen you can see.
    • Torpedoes can attack them in this area.
    • But a miss of torpedo’s attack will alert the target, so it will close in…
  • Sonar: in order to know where enemies locate at.
    • Dots flash on the right side of the screen periodically; these indicate locations of enemy.


  1. Download from GitHub https://github.com/yomogimaru/i4arduboy
  2. Open “i4arduboy.ino” with ArduinoIDE
  3. Click “Upload” button
  4. Enjoy!


Using flash memory 28,666 of 28,672 bytes. If you want to use EEPROM for ranking, configure build options in constants.h.

The original version (for windows) is here.


looks great, can’t wait to play this when I get my arduboy

I get this when compiling on Fedora 23 (Arduino 1.6.4, avr-gcc 4.9.3 from repositories):
Sketch uses 28,908 bytes (100%) of program storage space. Maximum is 28,672 bytes. Global variables use 1,739 bytes (67%) of dynamic memory, leaving 821 bytes for local variables. Maximum is 2,560 bytes. processing.app.debug.RunnerException: Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it.
The difference is probably the Arduboy library version, I think. Anyway I can’t play this as the binary created is too big.

Edit: Nevermind, works on Arch Linux (without music).

Do you know which version of the Arduboy Library you are using? Is it the official 1.1 from Github/Arduino Lib?

There is something wrong with Fedora’s Arduino packaging. All game had corrupted screens and they don’t work. I tried this on my laptop and that works just fine. The laptop has Arch Linux with Arduino 1.6.8 and avr-gcc 5.3.0.

I don’t know the Arduboy library version. It should be quite recent though, because I downloaded it something like a week ago. Is there a way to check the version? I didn’t find it in the readme file or elsewhere.

Oh, and I still need to #define DISABLE_MUSIC to make it small enough even on my laptop.

The version should be able to be found in the library.properties file, found in the library’s folder.

You can also install a standalone version of the Arduino IDE from their website. I hardly ever use the distro’s packages for Arduino… long time Debian user here ; )

Just download a standalone version from their website and remove the Fedora package.

1 Like

Mmmm also @Tomin, in the IDE you can use the library manager to search for the Arduboy Library, and install it that way, instead of manually adding the zip.

Manager says it’s 1.1.0. I can’t remember how I installed it. Could be through the manager though.

1 Like

I cannot install it. It is too big for me :frowning:

Quick and dirty solution:
Edit the library file Arduboy.cpp. In function Arduboy::begin() comment out the calls to
bootUtils() and bootLogo() (lines 30 and 32 for library V1.1.0).

This will eliminate the built in boot logo and “flashlight” mode to free up enough space.

The proper way to free up some memory this way is for the sketch to make it’s own equivalent of begin() using boot() and leaving out bootLogo() and/or bootUtils(). However, boot() is a protected function in V1.1.0. This has been corrected for V1.2.0 by making boot() public.

Easier solution for Arduboy library V1.1.0 only:
In the sketch file gamecore.h change line 20:

This, again, will eliminate the start up boot logo to free up code space.


Thank you MLXXXp!
I pushed the change to i4arduboy repository.

@Yomogimaru, you may wish to eliminate all the compiler warnings that this sketch is generating.

In gamecore.h change line 75:
inline void print(char* text) { arduboy.print(text); }
inline void print(const char* text) { arduboy.print(text); }

and change line 60:
inline void clearDisplay() { arduboy.clearDisplay(); }
inline void clearDisplay() { arduboy.clear(); }
or to
inline void clear() { arduboy.clear(); }
and change all the calls from clearDisplay() to clear().

In actor.cpp figure out why line 53
x = Clamp(x, 0, (SCREEN_WIDTH << 8) - MARGIN);
is causing
warning: integer overflow in expression [-Woverflow]
Maybe lines 51-54 should be:

  // clamping into field
  static const fixed MARGIN = 6;
  x = Clamp(x, 0, (SCREEN_WIDTH - MARGIN) << 8);
  y = Clamp(y, (MARGIN - H) << 8, (SCREEN_HEIGHT - MARGIN) << 8);

I have deleted my installation and dont add any lib and got a few errors but the game work now fine :slight_smile:

1 Like

@MLXXXp Many thanks! I did them and eliminate warnings except EEPROM unusing.

However, screen corruption still occurs rarely. I have no idea about this problem :sweat:

Those squares to the right that flash, they are a feature right? I’m not sure what they are for.

The squares show you where the enemies are coming from. The longer the squares / line, the shorter the distance between you and the enemy. It gives you a chance to shoot enemies off screen.

1 Like

It doesnt work for me.

Arduino:1.6.9 (Linux), Tarjeta:“Arduino Leonardo”

/home/ramonml/Descargas/i4arduboy/i4arduboy.ino:1:21: fatal error: Arduboy.h: No such file or directory
#include “Arduboy.h”
compilation terminated.
exit status 1
Error compilación en tarjeta Arduino Leonardo.

Este reporte podría tener más información con
"Mostrar salida detallada durante la compilación"
opción habilitada en Archivo -> Preferencias.

works flawless with the arduboy 1.0.
very strange that most games which actually run on the arduboy 1.0 do not work for you :confused:

i loooooooooooooooooooooooooooooooooooooooove this game :heart_eyes: but it is VERY hard !!!