This Python script (cube_game.py
) uses the Pygame library to create a simple cube runner game. The player controls a cube character that must navigate through obstacles while collecting points.
- Infinite Runner: The game has an endless scrolling environment with randomly generated obstacles.
- Player Controls: Use the arrow keys to control the cube character (up, down, left, right).
- Obstacle Generation: Obstacles are randomly generated with varying sizes, colors, and speeds.
- Scoring System: The player scores points for successfully navigating through obstacles. The game keeps track of the player's score.
-
Install Dependencies:
- Make sure you have Python installed on your machine.
- Install the Pygame library and colour using the following commands:
pip install pygame pip install colour
-
Run the Game:
- Execute the script using the following command:
python cube_game.py
- Execute the script using the following command:
-
Game Controls:
- Use the arrow keys to control the cube character:
- UP: Move Up
- DOWN: Move Down
- LEFT: Move Left
- RIGHT: Move Right
- Use the arrow keys to control the cube character:
- The game ends when the cube collides with an obstacle.
- After a game over, you can restart the game by following the on-screen instructions.
- You can customize various aspects of the game, such as the number of obstacles, obstacle properties (size, speed, color), and more by modifying the
cube_game.py
script.
If you have suggestions or find issues with the game, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License