Cube Dodger is a fast-paced 3D endless runner game built in Python using the Ursina Engine. You control a cube on a large platform, dodging dynamically spawning obstacles while managing increasing speed. The challenge? Survive as long as you can and beat your high score!
- ๐ฆ Free 3D Movement (Left, Right, Forward, Backward)
- ๐น๏ธ Dynamic Camera Modes (Follow, Fixed, Orbit, First-Person)
- ๐ง Randomized Obstacle Spawning (Low, Tall, Wide)
- ๐ Auto-Forward Mode Toggle
- ๐ Score & Speed Scaling System
- ๐ Real-time Metrics Display (FPS, Speed, Obstacles)
| Library | Purpose |
|---|---|
ursina |
3D game engine (main framework) |
random |
Obstacle spawn logic |
math |
Camera orbit & rotation math |
pip install ursinacube_dodger/
โโโ cube_dodger.py # Main game file (single-file project)
โโโ README.md # Project documentation
- Make sure Python 3.8+ is installed.
- Install required dependencies:
pip install ursina
- Run the game:
python cube_dodger.py
| Action | Key(s) |
|---|---|
| Move Left | โฌ ๏ธ Left Arrow |
| Move Right | โก๏ธ Right Arrow |
| Move Forward | โฌ๏ธ Up Arrow |
| Move Backward | โฌ๏ธ Down Arrow |
| Jump | Spacebar |
| Toggle Auto-Forward | V |
| Cycle Camera Modes | C |
| Adjust Camera Zoom | Page Up / Page Down |
| Restart (on Game Over) | R |
| Quit Game | ESC |
-
Obstacles spawn from all platform edges and move towards the center.
-
Obstacle Types:
- Normal Block (Red): Dodge sideways.
- Low Wall (Orange): Jump over.
- Tall Wall (Magenta): Must dodge sideways.
- Wide Block (Yellow): Occupies more space horizontally.
-
Collision with obstacles ends the game.
-
Game Speed increases every few seconds.
-
Camera Modes can be switched on-the-fly.
- FPS Counter
- Current Game Speed
- Active Obstacles Count
- Player Position Coordinates
- Camera Mode Status
If you like this project, don't forget to โญ๏ธ star it on GitHub!