Force Cube Runner is a 3D obstacle-avoidance game built in Python and OpenGL with optional Arduino-based hardware controls.
Players navigate a cube across three lanes while jumping or crouching to avoid obstacles.
This project was built during StormHacks 2025 as a hardware–software integration demo.
- Three-lane movement (left / center / right)
- Jump and crouch to avoid obstacles
- Increasing difficulty over time
- Survival timer displayed during play
| Keyboard Controls | Arduino Controls | Arduino Setup |
|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
- Python + OpenGL 3D rendering
- Keyboard controls always available
- Arduino joystick + ultrasonic sensor supported when detected at startup
- Left / Right Arrow – Change lanes
- Up Arrow – Jump
- Down Arrow – Crouch
- Joystick X-axis – Lane switching
- Ultrasonic sensor distance – Jump / crouch
Arduino availability is checked during gameplay; behavior depends on connection state
- Arduino Uno or Nano
- Analog joystick module
- HC-SR04 ultrasonic sensor
Ultrasonic Sensor:
VCC -> 5V
GND -> GND
Trig -> Pin 9
Echo -> Pin 10
Joystick:
VCC -> 5V
GND -> GND
VRx -> A2
VRy -> A3
Upload:
game_controller_combined/game_controller_combined.ino
- Baud rate: 115200
Force_Cube_Runner/
├── base_arduino.py # Main entry point; initializes game loop and selects control mode
├── controls.py # Keyboard input handling and movement mapping
├── arduino_controls.py # Serial communication and parsing of Arduino sensor input
├── shapes.py # OpenGL geometry definitions for player and obstacles
├── sphere_manager.py # Obstacle generation, movement, and collision logic
├── lane_markers.py # Rendering of lane guides and track visuals
├── game_timer.py # Survival timer and on-screen time display
├── start_screen.py # Start screen UI for keyboard-only mode
├── arduino_start_screen.py # Start screen UI when Arduino is detected
├── button.py # Reusable UI button components
├── MrElectric.png # Texture asset used for obstacle rendering
└── game_controller_combined/
└── game_controller_combined.ino # Arduino firmware for joystick + ultrasonic sensor input
pip install -r requirements.txt
python base_arduino.py
Arduino joystick + ultrasonic sensor supported when available
- Arduino availability is checked during gameplay; behavior depends on connection state
- Serial port is hardcoded (adjust in
arduino_controls.pyif needed) - No in-game calibration for sensor thresholds




