Ardulem - The Lemmings arrive on Arduboy!

Yes, me too!

When I first think of which game I would make on my Arduboy, I looked at the screen resolution, and those tiny pixels, remember me those pixels I was fighting in my Lemmings gaming session during the last century… Then I thought, yeah Lemmings might be a good choice :slight_smile:


What is the reason that you created a custom local version of the Arduboy library?

Switching to the Arduboy2 and ArduboyPlaytune libraries would probably free up a fair amount of progmem space.

is there a hex file,so that i can upload it with Arduboy Manager?

Well, I guess there’s no real reason. I started with the Arduboy 1 library, then complete most of the game when I started to do optimization.

However, I distorded quite a lot of original function of the library to make it more specific to my project. For example in the drawBitmap() function, I removed the vertical iteration because all the bitmaps that I need to draw are only 8 pixels high.

However, there’s still some valid optimization that I’ve done in that function, that could still be applied in the Arduboy2 lib (I’ve just checked and the drawBitmap function didn’t changed between version 1 and 2).

For example caching the variable instead of copy/pasting for the 3 colors, or computing a start and end value for the for loop instead of testing and break the loop both increase the speed and decrease the progmem size (according to my test).

Also I’ve added a mirror flag (on X) to that drawBitmap() function, which is quite free I guess on the performance side, and could be very handy to many developpers, because you often want to play a character walking to the right of the screen, then mirror the animation to make it walk to the left. This would be a cool and legid parameter to add to the lib, I guess.

The mask parameter that I added, is too specific to my game, and I think should not go in the lib.

A mirror on Y would be also a nice addition, even if it would be more costy, as you would have to write the bits in reverse order.

Anyway, I think I will start my next game from Arduboy2 (and hopefully won’t need to change it).


Hi gambler172,

Sorry, no I don’t know how to do it, since I didn’t dig into how to do it. However, I’ve heard of the Arduboy Manager, as an easy tool to download game in your Arduboy.

I can certainly add this. Does anyone know which doc I should read to learn how to do it?

But you would be better to include the .hex file in a .arduboy file.

Thanks a lot!! That’s really an extensive answer.

I think, I will then create a release folder in my repo, to put that file + a compile version of the Editor some time to time.

Stay tuned! :slight_smile:

1 Like

If you’re only modifying a few library functions, in many cases it’s better to just make local versions of these functions instead of copying the entire library. This way you can easily take advantage of any optimisations, enhancements or additions made in areas that you haven’t customised.

If you have any optimisations that are backwards compatible, you can submit them and I’ll consider them for inclusion in the library.

You’re saving game data at offset 10 in EEPROM. The first 16 bytes of EEPROM is reserved for system use. Your sketch should only use EEPROM from defined offset EEPROM_STORAGE_SPACE_START and above.

Also, it’s better to use EEPROM.update() instead of EEPROM.write() to prevent unnecessary writes to EEPROM.

Awesome. This brings back some memories

Oh wow! so polished, amazing :smiley:

I uploaded your game to my repo

Yes, in the upper link :slight_smile:

1 Like

Alright, I will update that ASAP.

Ok, I’ve made the two changes regarding the EEPROM.

I’m now building the .arduboy file. It should be available in a coupe of hours.

Hey Scott,

Are you maintaining the Arduboy library ?

Yes, I think I can come with a clean and backward compatible, optimized version of that function. Please give me some time.


Yes but only for bug fixes, since it’s now a legacy library and not recommended for new sketches.

All new development is being done for the Arduboy2 library, for which I will consider any submitted fixes and enhancements.

Yes, I was talking for the Arduboy2. How can I submit you an enhancement? Is there a thread in the forum?

1 Like

Hello All,

I’ve uploaded a .arduboy file in the Release folder of my repo. I could import it in ArduboyManager, however, I couldn’t test the transfert, since all the game I tried to transfert to my Arduboy with the ArduboyManager was not successful (just freezing the ArduboyManager).

Please let me know if you try it, and if it works for you.

Also I’ve added a compiled version of the Editor (should run directly on Windows, and on linux/Mac you can run mono in command line giving the exe file in parameter).


The best way is to create a pull request on GitHub. You could also create a new issue on GitHub, containing the proposed changes.

Alright Scott,

I’ve just created an issue, where I attached a test program, with my “optimized version” which is of course backward compatible.

Feel free to test and do whatever you want with it. :smile: