Formula One Dodger Game

Overview

Formula One Dodger is a simple, yet engaging game developed using Pygame, a set of Python modules designed for writing video games. In this game, the player controls a car that must dodge incoming obstacles. The game increases in difficulty as the player's score increases, with the speed of incoming obstacles gradually increasing.

Features

  • Player Movement: Control your car with the left and right arrow keys to dodge obstacles.
  • Dynamic Obstacles: Obstacles appear randomly and increase in speed as your score increases.
  • Score Tracking: Your score increases as you successfully dodge obstacles.
  • Speed Display: The game shows the current speed of obstacles.
  • Collision Detection: The game ends when your car collides with an obstacle.

Here's a look at the game:

Formula One Dodger Screenshot

Requirements

To run this game, you will need:

  • Python 3.x
  • Pygame library

Installation

Before running the game, ensure you have Python installed on your system. You can download Python from python.org.

After installing Python, install Pygame using pip. Run the following command in your terminal or command prompt:

pip install pygame

Running the Game

To start the game, run the Python script. You can use an IDE or the command line to do this. If using the command line, navigate to the folder containing the game's script and type:

python main.py

Controls

  • Left Arrow Key: Move the player car to the left.
  • Right Arrow Key: Move the player car to the right.

Game Play

Avoid the obstacles that come from the top of the screen. Each obstacle dodged increases your score by 10 points, and the speed of obstacles will also increase. The game tracks and displays your current score and the speed of obstacles.

Ending the Game

The game ends when your car collides with an obstacle. Your final score will be displayed in the console.

Customization

You can customize various aspects of the game such as car size, obstacle size, screen size, and colors by modifying the constants at the beginning of the script.

License

This game is free to use and modify. It's a great starting point for those learning game development with Python and Pygame.