Cross-Platform Mobile Game with Solar2D
Build an endless runner game for phones with Solar2D (formerly Corona), a free framework for 2D mobile games written in Lua: the player character runs automatically, and you tap to jump over obstacles that come faster and faster, while the score counts up. Obstacles and collisions use Solar2D's built-in Box2D physics engine, screens (menu, game and game over) are organized with Solar2D's scene manager, and the best score is saved on the device. At the end you'll build an Android app and try it on a real phone or emulator. You'll learn game loops and scenes, physics bodies and collisions, touch input, spawning and cleaning up objects, saving data, and building a mobile app.
- Estimate
- ~9h
- Steps
- 6
- Completed by
- 0
- Proposed by
- codeseed.app
Solar2D · Box2D physics
Project roadmap
- 01
Set up the project and scenes
~1.5hInstall Solar2D and create a project with config.lua (content size and scaling for different screens) and main.lua. Use the composer library to create three scenes: a menu with a Play button, the game, and a game over screen. Switch between them with composer.gotoScene. Done when: the simulator shows the menu, and Play opens the game scene.
- 02
Add the player and controls
~1.5hStart the physics engine, add the ground as a static body and the player as a dynamic body (with a sprite or a simple shape), and make a tap anywhere on the screen apply an upward impulse to jump, but only when the player is on the ground (tracked with collision events). Done when: tapping makes the player jump, and it can't jump again in mid-air.
- 03
Spawn obstacles
~2hSpawn obstacles at the right edge at random intervals with timer.performWithDelay, moving left at a speed that increases over time (as kinematic bodies with a velocity). Remove obstacles and their listeners once they leave the screen, so memory doesn't grow. Done when: obstacles appear faster over time, and the number of objects stays stable during long games.
- 04
Add scoring and game over
~1.5hIncrease the score over time (or per obstacle passed) and show it on screen. When the player collides with an obstacle, stop the game (pause physics and cancel timers), and go to the game over scene with the score. Save the best score to a file in system.DocumentsDirectory (as JSON with the json library) and show it. Clean up everything when leaving the game scene. Done when: collisions end the game, and the best score is kept between sessions.
- 05
Add polish
~1hAdd simple sounds (jump and crash, with audio.loadSound), a scrolling background for a sense of speed, and pausing when the app goes to the background (with a system event listener). Done when: the game feels responsive, with sounds and a moving background.
- 06
Build for Android and test
~1.5hConfigure build.settings (app name, orientation and version), build an Android APK from the Solar2D simulator, and install it on a phone or emulator. Test on at least two screen sizes and fix any layout or performance problems. Done when: the game installs and plays well on an Android device or emulator.
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack