Skip to content

iamtahasc/Collision-Detection-Car-Racing-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Collision Detection Car Racing Game

A Python-based car racing game featuring real-time collision detection, built for learning and fun! Control your car, dodge obstacles, and compete for the highest score.

Features

  • Real-time Collision Detection: Accurate collisions between cars and obstacles for a challenging experience.
  • Custom Graphics: Includes images for cars and the road for a visually engaging interface.
  • Score Tracking: Keeps track of player performance throughout the game.
  • Simple Controls: Easy-to-learn controls for quick gameplay.

Getting Started

Prerequisites

  • Python 3.x
  • pygame library

Install pygame using pip if you don't have it:

pip install pygame

Installation

  1. Clone the repository:
    git clone https://github.com/iamtahasc/Collision-Detection-Car-Racing-Game.git
  2. Navigate to the project directory:
    cd Collision-Detection-Car-Racing-Game
  3. Ensure all image files (LeftCar1.jpeg, RightCar1.jpeg, Road.jpeg) are present in the directory.

Running the Game

python main.py

How It Works

  • The game window displays a race track with two cars and a scrolling road.
  • Control your car using the keyboard to avoid obstacles and other cars.
  • The collision detection algorithm checks for overlaps between the player’s car and obstacles, ending the game on collision.
  • The game keeps track of your score, which increases the longer you avoid collisions.

File Structure

  • main.py - Main game logic and loop.
  • LeftCar1.jpeg, RightCar1.jpeg - Car images used in the game.
  • Road.jpeg - Road background image.

Customization

You can replace LeftCar1.jpeg, RightCar1.jpeg, and Road.jpeg with your own images to personalize the game.

License

This project is open-source and available for any educational or personal use.

Credits

Developed by iamtahasc.


Enjoy racing and improving your programming skills!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages