🚙 Try Not To Crash!

< Back to Projects

< Back Home

Racing Car Game Main Menu

Figure 1: The main menu of my GUI game Try Not To Crash!.

Summary

This personal project is a Python (version 3.9) game developed using the Pygame library. Try Not To Crash! is a survival game in which the player drives a car and avoids falling obstacles. The player can drive the vehicle left or right across the screen to dodge the obstacles falling from the sky!

The game features many elements, including a main menu, a pause menu, and different game modes. The game modes add to the game's challenge by progressively making the falling blocks harder to dodge!

The game also includes sound effects and background music, managed using Pygame's mixer module. Pygame also manages its graphics, drawing functions, and image-loading capabilities!

The game's code is organized and modular, with separate functions for handling different aspects of the game, such as drawing the game objects, handling user input, and managing the game state. The code also demonstrates Pygame's event-handling system in response to user actions such as keyboard inputs and mouse clicks!

Motivation

I wanted to build my first project to add to my portfolio in the summer of 2024, so I decided to create a video game with a GUI (graphical user interface) using Pygame because I like playing video games, so why not create one?

Coding this game was so fun that I finished the project in three days!

Source Code