Anarch: Doom-like game

Hello, this is a port of my game Anarch for ESPboy. It is a public domain Doom-like game with 10 levels that’s designed to be very portable, you can play this on different devices including PC and browser (website). Naturally I welcomed the possibility to port it to ESPboy :slight_smile:

On ESPboy it looks very nice, I am loving it. The port could potentially be improved, feel free to play around with it. Here are specific details about this port:

  • FPS is set to 22. It looks good, although I think it could go much higher if someone figures out how to compile this with -O3 (optimize for speed) instead of -Os (optimize for size) optimization flag (currently the TFT library refuses to compile without -Os).

  • Sounds are only simple beeps. The game has its own sounds and music that can be played if the platform allows it, but it was too difficult for me to figure out how to play arbitrary sounds from memory, so I simply use the tone() function for shooting etc. Again, feel free to improve this.

  • Saving/loading is an optional feature (chosen by define in the source code). With saving off you can play any level from the start. With saving on you need to unlock levels and can save your position. The data is saved using the EEPROM emulation library to flash.

  • I didn’t use the common ESPboy classes and wrote everything in one file (main_espboy.ino), which prevented me from using LED easily, but you can add LED effects if you want.

  • You can either download the compiled bin and upload it to your ESPboy, or compile this yourself. To compile, take the file main_espboy.ino file and all *.h files from the game repository, put them in a directory and compile the ino file with Arduino IDE, as you do with any other project.



  • arrows: movement
  • A: shoot, confirm
  • B: hold to strafe
  • right side button (=C): + U = jump, + D = menu, + A/B/L/R = change weapons
  • left side button: map

Huge thanks goes to people on this forum who helped me with programming issues.


Looks great!
Playing it 30min nonstop )
Thank you so much for such a great opotunity to have fun with Anarch )

1 Like

But you said:


there are always exceptions to the rule)

Many thanks, it’s a top game. I hope that we’ll be able to optimize it again and be able to play sounds but it’s already an amazing game. It was already amazing on the Gmebuino Meta (and so i know how sounds can be good and i have been able to test the save functionality) andi hope that we’ll have it too later with the Espboy to exploit the game the best we can.

changing render a bit we’ve got more than 30 fps )
(don’t forget to put tft.setSwapBytes(true); into setup(){} after TFT initialisation and
put palette itself to RAM:
/*SFG_PROGRAM_MEMORY*/ uint16_t paletteRGB565[256] = {...} )

  for (uint32_t i = 0; i < SFG_SCREEN_RESOLUTION_X * SFG_SCREEN_RESOLUTION_Y; i++)
  static uint16_t scrbf[SFG_SCREEN_RESOLUTION_X];
  uint32_t readscrbf=0;
  for (uint32_t j=0; j<SFG_SCREEN_RESOLUTION_Y; j++){
   for (uint32_t i=0; i<SFG_SCREEN_RESOLUTION_X; i++)
   tft.pushPixels(&scrbf, SFG_SCREEN_RESOLUTION_X);

Anarch on ESPboy with original music and digital sound fx. Thanks to @shiru8bit - Alex Semenov for this improvement


Many thanks. It’s the demo game atm i think (even there is alot of great games, this one is very good to see what can be done…)

Wow, thanks Shiru very much :slight_smile: Gonna try it out.

1 Like

I think it would be fun to use ESP NOW technology for a co-op game in Anarch3d. Anarch3d Arena, probably. )

1 Like