Battleships for Arduboy!

My little project, that’s how far i came today.


I love this little boy.


Graphics look cool:) lol but wait till the little squares pop up for the actual game play;)

I looking forward to this btw:)


I need to post more WIP, i rly love this little thing.

Added a VS screen which show who plays. Enemy is picked randomly.
Love the animations.



Could you show me how you did the graphics?


The characters, the ship background and the VS-symbol are made in Photoshop then exported to this great tool for chrome.
Here s a sample project with a photoshop file War themed 8x8 sprites

All other animations as the selected BG and the swipe stuff are made by code.

1 Like

More progress!

This time HUGE changes. Only the game logic itself is missing.
Sadly i reached 98% memory so i needed to kick one artwork.

Also i never coded something this low level so i have no idea about code optimization so i could lower the size.
I will need to kick more bitmaps which wouldn’t be a problem if there where a smaller font since a couple of my assets are only there for UI… xD

Hope i can finish it on the next weekend! :metal:


1 Like

Are you using the Arduboy library and do you use arduboy.begin(); in setup()? If so, you can gain back a bit of code space by eliminating the ARDUBOY boot logo that scrolls down before your code starts. Replace


Yeah thank you, i know that, but i like this logo so much. <3 It belongs there like the gameboy logo on the original gameboy!
So i will use it as last resort but will try to safe space elsewhere. xD


So i rewrote the game the past couple of days without using any lib functions like print/drawLine/fill/whatever.
I’ll replace all things i did with them with sprites as far as it works.

Until now i’m down to 22 kb which is great. Now i have around 6k left which should be enough for some nice sounds or whatever.
I’ve also had an idea to switch from an 8x8 tileset to a scrolling 16x16 one which would only cost 384bytes in asset data more and possibly looks way cooler.

Anyway, now i have to wait for my new arduboy to continue, since right now i’m doing everything in the dark without testing. :sweat_smile:


I really want to get rid of memory restrictions! It’s for sure a challenge to make things small but it also makes other things impossible. Keep up the amazing work!


But it also help to find creative methods to save space for more cool stuff. :slight_smile:
Anyway i understand you and yeah it would be great to have a bit more room…
I wish i would be possible to optimize the whole draw methods so they won’t eat up that much.
Sadly i have no background in such low level graphic coding so i could help, don’t even know if it’s possible. :frowning:


New Arduboy arrived! back to coding :smiley: So glad.


I’m so frustrated. Weird things are happening and i don’t know why.

I have started to rewrite the whole game class based which is really nice but the arduboy keeps restarting at some random (reproducible) point. Sounded like an memory issue but i don’t believe that use that much RAM.

Then i tried to run it with the Arduino IDE (I’m coding entirely in PlatformIO) and the the game stops at the Arduboy-Logo.

This is really really frustrating because i’m just debugging for two weeks and i don’t know what’s the reason for this.

Can anyone look over my code and help me?

Here’s the repo.
To run it on Arduino IDE simply cpy the /src folder and rename it to BattleshipAdvanced.
Pls don’t clone it if you expect a working game.

Update 1:

Well now i have tried freeMemory() which magiclay returns me how much RAM is free. Sadly it returns magic values (it starts with 40, dunno if potatoes, percent or whatever. If it’s really just 40 bytes left, then something else wrong since i tried it in an empty sketch only with an arduboy instance) but i see it shrinking while i going deeper in the methods down to 90.

Update 2:

My mistake, in a fresh sketch freeMemory() says 1270, which is fine. so it’s definitely my class and code wich eats all RAM. - DAMN it’s so hard to debug this :cry:

Update 3:

I just noticed that 1270 byte free is not alright in a clean sketch just with an Arduboy instance.
Does the arduboy system really eats the half RAM?!

Update 4 FIXED!!!:

Wow really dumb issue which i finally have fixed after 2 weeks.
I’ve initialized a second instance of arduboy instead of referencing it. Sadly the Arduboy lib uses up 1 whole KB of Ram.
freeMemory() is very handy for debbuging.


i think sketch have double Arduboy Memory(BAInput and BAGame).
it is double sBuffer.

unsigned char sBuffer[(HEIGHT*WIDTH)/8];

i fix BAInput.h and some souce code.


Arduboy arduboy;


Arduboy *arduboy;

i can see title screen.

edited: oops my advice is too late :slight_smile:


Nevermind, i really appreciate the help! <3


@akkera102 may you tell me how you did find it so fast?
Do you have some nice tools i don’t know about or are you just a genius? :wink:

i dont use nice tools. lol
only // and any functions.

first, i found freeze arduboy title. so i look for normal running point.


//  arduboy.clear();
//  arduboy.display();

  // init input
  // input = new BAInput(arduboy);    // <---- bug??

  arduboy.clear();     // <---- Arduboy "runed" clear screen

  activePlayer = NULL;
  opponentPlayer = NULL;

if Arduboy use BAInput, it broke.
I write BAInput instance of all comment out.

BAInput::BAInput(Arduboy &arduboy){
  // fireContinuous = false;
  // refireAfterMillis = 500;
  // this->arduboy = arduboy;
  // reset();

but it broke… why? why? i see header file.

class BAInput{


    BAButton buttons[6];
    Arduboy arduboy;

It was often seen. not pointer!

i found answer. :grin:


hahaha nice, simple as that :smile:. I failed for about a week. :sweat_smile:


soooooooooooooooo any progress? im eagerly awaiting this one

1 Like