A 2D physics-based side-scrolling driving game with procedurally generated terrain.
-
An alien has depleted his magic goo fuel, and now has to use petrol like a real man. Unfortunately the fumes got the best of him and now he's on an endless voyage to get sober.🌌
-
Available in M5Burner and M5Launcher!
-
⚙️ Custom Physics Engine:
- Simulates a chassis and two wheels connected by suspension.
- Includes gravity, drive torque, leaning torque, suspension forces, friction, and air resistance.
- Uses physics sub-stepping for improved stability.
- Handles collisions between the vehicle, rider, and terrain.
-
🏞️ Procedural Terrain:
- Endless, varied landscape generated on-the-fly using line segments.
- Checkpoints mark distance milestones.
-
🖼️ Dynamic Backgrounds:
- Parallax scrolling Starfield, Nebula, and Meteor Shower effects.
- Smooth transitions between background types based on distance traveled.
-
🎨 Graphics & Rendering:
- Utilizes the M5GFX library via the M5Cardputer library.
- Renders to an off-screen buffer for smooth, flicker-free animation.
- Rotating sprites for the vehicle and rider.
- Particle system for wheel dirt effects.
-
🎮 Gameplay & UI:
- Simple controls for acceleration and leaning.
- Game over on crashing or falling.
- Tracks total distance and saves the high score.
- Configurable on-screen display for FPS and distance.
- Main Menu and detailed Options Menu.
-
💾 Options & Persistence:
- Adjustable settings: Brightness, Volume, Gravity, Torque, Info Corner, Smooth Camera, Terrain Color, Menu Background.
- Settings and high score saved persistently using the Preferences library.
-
🔊 Audio:
- Simple synthesized sound effects for engine, menus, game over, and high score.
- Objective: Drive as far as possible without crashing.
- Controls (Default Keyboard):
Space: AccelerateA: Lean LeftD: Lean Right- Menus:
Up Arrow: Navigate UpDown Arrow: Navigate DownLeft Arrow: Decrease Value (in Options)Right Arrow: Increase Value (in Options)Space: Select / ConfirmEsc: Back (from Options)
This project is designed for the M5Stack Cardputer.
- Prerequisites:
- Arduino IDE or PlatformIO installed. 💻
- M5Stack Board definitions installed for your IDE.
- M5Cardputer Library installed. (This library includes the necessary M5GFX dependency). 📚
- Clone the Repository:
git clone https://github.com/Treblewolf/M5Cardputer-Sun-Rider.git cd M5Cardputer-Sun-Rider - ⚡ Build & Upload:
- Arduino IDE:
- Open the
.inofile, select the correct M5Stack Cardputer board from the Tools menu, go toSketchandExport Compiled Binary - Copy the compiled
.binfile onto SD card and run through M5Launcher
- Vec2D Struct: Custom 2D vector implementation for physics calculations.
- State Machine: Simple
enum GameStatemanages game flow. - Scrolling Options Menu: Handles more options than fit on the screen.
- Smooth Camera: Toggable camera smoothing for player following. 🎥
- Color Fading/Blending: Helper functions for visual effects.
- Sprite Rendering: Uses
pushImageRotateZoomWithAAfor anti-aliased rotated sprites. - Background Management: Intelligent wrapping and resetting of background elements.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
Distributed under the MIT License. See LICENSE file for more information.


