A simple 2D car racing game built with Pygame.
This is my first Pygame project — created to learn game development concepts like movement, collision, world design, and rendering.
- 🎮 Player-controlled car with movement & steering
- 🛣️ Road/track system built with nodes and world logic
- ⚡ Real-time game loop with smooth frame updates
- 💥 Collision detection with boundaries/obstacles (if implemented)
- 🌍 Modular code (
world.py
,node1.py
, etc.) for easier expansion
2d_Cargame/
│── main.py # Entry point of the game
│── world.py # Handles track/world design
│── node1.py # Node system (road/track navigation)
│── decorators.py # Helper decorators (if used for functions)
│── test.py # For testing functions/modules
│── assets/ # Sprites, car images, background, etc.
│── README.md # Documentation
(Default — update if different in your code)
- ⬆️ Up Arrow / W – Accelerate
- ⬇️ Down Arrow / S – Brake / Reverse
- ⬅️ Left Arrow / A – Steer Left
- ➡️ Right Arrow / D – Steer Right
- ❌ Esc – Quit game
-
Clone the repository
git clone https://github.com/Osaidgit/2d_Cargame.git cd 2d_Cargame
-
Install dependencies Make sure you have Python 3.x installed. Then:
pip install pygame
-
Run the game
python main.py
(Add screenshots of your game here — you can take them while playing and save in /assets
or /screenshots
folder.)
Example:
- Add AI opponent cars 🚘
- Add scoring & lap timer ⏱️
- Create multiple levels / tracks 🌍
- Add background music & sound effects 🎵
- Improve graphics with animations & particle effects ✨
Osaid Ali
- GitHub: Osaidgit
👉 Feel free to fork this repo, raise issues, and contribute improvements!