Lucky World – A jump'n'run game for MeggyJr RGB

published: December 17, 2014 — last modified: October 23, 2025

Today I release a full featured jump’n’run game for the MeggyJr RGB platform. It has an intro, a level map with more than 16 levels packed with obstacles and even a end scene. This game uses most of the flash of the ATmega328P and it was an interesting challenge to keep everything as compact as possible. In the past, when I learned to develop software, a very limited RAM was normal. Creating this game for this platform brought back a little bit of this nostalgia.

I release all sources of the game under the GPL v2 license. Feel free to create your own fork and improve this game even further. You can download a ZIP with the sources for version 1.0 here:

https://github.com/LuckyResistor/LuckyWorld/archive/v1.0.zip

To give you a quick impression of the gameplay, I created the following video.

Read more about the requirements for the game in the sections below.

Requirements

  • The game requires the LRMeggyJr library version v1.2 found at this URL:

    https://github.com/LuckyResistor/LRMeggyJr/archive/v1.2.zip

    Copy the folder into “Arduino/libraries” and rename it to “LRMeggyJr”.

  • Arduino v1.5.8 or newer is required to compile this game. Download it from the following location:
    http://arduino.cc/en/Main/Software (See BETA section).

  • You need version 1.3 of the MeggyJr RGB hardware. Probably the game is working with previous versions, but I coult not test it.

How to Play

Your are the white dot on the screen. Use the left and right button to walk left and right. Press the A button to jump. You can hold down the B button to run slightly faster (and therefore make a longer jump).

The goal of the game is to reach the portal (flashing blue) at the end of the level without getting killed by holes, water, lava, canons or monsters.

If you collect more than 64 coins you will get an extra life.

You can see the current number of lives displayed using the yellow extra LEDs on top of the display. The maximum number of lives is 8.

If you die and lose you last life, the game is over and you will lose your progress so far.

The game has 16 regular levels divided in four blocks a four levels. If you successfully finish one block of four regular levels, you will not lose this progress on game over.

There are some secret and hidden exits on the middle of some levels.

Game Elements

  • In some levels there is a sky background which goes from dark blue to dark pink.
  • Green dots are solid ground. But there are moving platforms which are of a slightly brighter green.
  • Yellow dots are coins.
  • Bright blue is water, you will drown in water.
  • Orange is lava. There is flowing lava like water, but also jumping lava fire balls.
  • Pink are canons. Just before a canon fires a new bullet, the cannon will start to flash slightly.
  • The canon balls are bright red and flashing.
  • There are also moving monsters in different sizes which are red.

Source Code

You will find the source code for the game at the following location. I released the code under the GPL v2 license.

https://github.com/LuckyResistor/LuckyWorld

I hope you have a lot of fun with this game! If you have any questions about the code, feel free to leave a comment, I will try to explain more details in further ports.

Best, Lucky Resistor

More Posts

Yet Another Filament Filter

Posted on 2020-12-20— 3D Printing, Projects

I've designed a simple magnetic filament filter that snaps onto a 16mm feed-through to catch dust and particles with a microfiber-wrapped sponge. It's easy to attach, low-friction, and printable in PETG — STL and Fusion360 files are included. Read the full post for printing, assembly and download links.

Read this post

Snowflake Power Converter

Posted on 2018-01-11— Projects

I built a simple USB-to-3.3V power converter for my snowflake decoration using a Traco TSR2-2433 and a laser-cut acrylic case with glow-in-the-dark engravings. I'll walk through the board, Fusion360/Eagle workflow, laser cutting and painting - read on if you want the files and build notes.

Read this post

Adafruit PowerBoost 1000C Enclosure (LR2165)

Posted on 2021-08-21— 3D Printing, Projects

I designed a simple three-part 3D printed enclosure for the Adafruit PowerBoost 1000C and up to a 1200mAh LiPo. In this post I share the print files, component list, and step-by-step assembly tips to convert the board into a safe portable power pack — please read on if you'd like to build one.

Read this post

Logic Gates Puzzle 101

Posted on 2023-02-02— Puzzle

I created a logic-gate puzzle featuring a gated D latch: more artwork than optimized circuitry. I invite you to try decoding the hidden message—there are hints and links to gate and flip-flop basics in the post. I hope you enjoy the challenge; read the full article if you'd like to solve it.

Read this post

Make your Code Safe and Readable with Flags

Posted on 2018-05-06— C++, Improve your Code

I show how a small C++ flags template makes embedded register bitmasks safer and much easier to read. I'll explain why macros and CMSIS-style definitions lead to errors, and walk through clear C++11 examples and a simple driver. Read on to see the implementation and usage.

Read this post

Real Time Counter and Integer Overflow

Posted on 2019-07-10— C++, Improve your Code, Learn

I walk you through how real-time counters work, why integer overflow is usually harmless when you treat time as relative, and practical, Arduino-ready comparisons and code examples to avoid timing mistakes. If you want concrete patterns and simple tests, read the full post.

Read this post