2D Retro Car Game¶
Welcome to the documentation for the Endless Car Highway, a simple SFML-based project that is inspired by the mobile classic from Nokia.
βοΈ Setting Up the Project (Visual Studio + SFML)¶
Follow these steps to build and run the game on Windows:
- Install Visual Studio 2022 (with C++ Desktop Development tools).
- Download and install SFML 2.6+.
- In your Visual Studio project:
- Add SFML include and library paths (
IncludeandLibfolders). - Link the required SFML libraries:
sfml-graphics,sfml-window,sfml-system. - Copy the SFML
binDLLs to your projectβs executable directory. - Build and run the project.
For a visual setup guide, watch this tutorial:
π‘ What is SFML?¶
SFML (Simple and Fast Multimedia Library) is a C++ library for graphics, audio, and input handling.
It allows developers to easily create 2D visualizations, games, and interactive tools.
This project uses SFML to render smooth gameplay of a 2D, 4 lane Car game.

π Learning Phase¶
For someone who had worked almost entirely in console before, there was much catching up to do. Aside from the basic creating a window, there was much more to learn such as: - creating sprites - tracking mouse/keyboard input - handling collisions - screen transitions
And much more!
Thankfully a YouTube playlist did make my journey smoother and easy to understand by explaining these concepts with proper code. Although I did only watch GAME 1 (videos 1 to 12), the rest of the playlist is just as enlightening if not more and can help to create even more diverse types of games swith SFML.
π§© Project Idea and Code Overview¶
The project demonstrates how a basic game works from new game to pause menu to setting difficulty and even seeing high scores!
Core Functionality¶
- The user starts at the main menu.
- The choices are:
- New Game: Start a new game.
- High Scores: See top scores.
- Options: Set difficulty from easy, medium, hard.
- Controls: Help menu showcasing controls.
Main Components¶
- main.cpp: Runs the Game loop until user escapes or closes the window.
- support.h / support.cpp: Renders all the game screens, player car movement, spawning opposing cars, updating high scores, changing difficulty, etc.
π§ͺ Demo Implementation¶
Hereβs a couple of videos of the running game:
This demo shows the real-time gameplay.
π Running the Executable¶
- Download the ZIP file (same name as repository) from the projectβs main directory.
- Extract it into any folder.
- Run the exe file:
(Currently supports Windows only.)
No installation or configuration needed β everything is self-contained.
π Concepts Learned & Future Scope¶
Concepts Learned¶
- Working with SFML graphics and event handling
- Structuring C++ OOP code for creating classes of cars/trucks/vans.
- Implementing real-time dynamic gameplay and points and difficulty system.
- Debugging for out of bounds and wrong indexing errors and fixing them for smooth operations.
Future Scope¶
- π§± Improved UI
- π§ Cross-platform builds (Linux / macOS)
- β‘ Support for more gameplay mechanics (invincibility token, more opposing vehicles,etc)
- πΎ Option to save and load savestates (Continue option).
π§ Credits¶
Developed by Once-1296
Licensed under the MIT License
This documentation site is built with MkDocs Material, featuring dark/light mode, navigation sidebar, and full-text search.

