Skip to content

H0NEYP0T-466/Car_Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš— Car Game

GitHub License GitHub Stars GitHub Forks Contributions Welcome GitHub Issues Car Game Banner

A classic console-based car racing game built in C++ where you dodge enemy cars and try to achieve the highest score possible!

๐Ÿ”— Quick Links

๐Ÿ“‹ Table of Contents

๐Ÿ“– About

Car Game is an exciting console-based racing game that challenges players to navigate through traffic while avoiding collisions with enemy vehicles. Built entirely in C++, this game demonstrates classic game development concepts including:

  • Real-time console graphics manipulation
  • Collision detection algorithms
  • Score tracking and persistence
  • Simple AI for enemy vehicle movement
  • Interactive menu system

The game features ASCII art graphics, smooth gameplay mechanics, and a ranking system to track high scores across gaming sessions.

โœจ Features

  • ๐ŸŽฏ Real-time Gameplay - Smooth car movement and enemy AI
  • ๐Ÿ† Score System - Track your high scores with persistent storage
  • ๐ŸŽจ ASCII Graphics - Retro-style console-based visuals
  • ๐ŸŽฎ Simple Controls - Easy-to-learn keyboard controls ('a' for left, 'd' for right)
  • ๐Ÿ“Š Rankings - View your best scores and compete with yourself
  • ๐Ÿ”„ Infinite Gameplay - Continuous enemy spawning for endless fun
  • ๐Ÿ’พ Score Persistence - Scores are saved to file for future sessions
  • ๐ŸŽต Menu System - User-friendly interface with multiple options

๐Ÿ› ๏ธ Built With

Languages

C++

Libraries & APIs

Windows API

Tools

Visual Studio Git GitHub

Platform

Windows

๐Ÿ“ฆ Installation

Prerequisites

Before running the Car Game, ensure you have:

  • Windows Operating System (Required for Windows API functions)
  • C++ Compiler supporting C++11 or later
    • Microsoft Visual Studio (Recommended)
    • MinGW-w64
    • Dev-C++
  • Git for cloning the repository

Setup Steps

  1. Clone the repository

    git clone https://github.com/H0NEYP0T-466/Car_Game.git
    cd Car_Game
  2. Compile the game

    # Using g++ (MinGW)
    g++ -o car_game project.cpp
    
    # Using Visual Studio Developer Command Prompt
    cl project.cpp /Fe:car_game.exe
  3. Run the game

    # Windows
    ./car_game.exe
    # or simply
    car_game

๐ŸŽฎ How to Play

  1. Launch the game by running the compiled executable

  2. Choose from the main menu:

    • 1 - Start Game
    • 2 - Instructions
    • 3 - Rankings
    • 4 - Quit
  3. Game Controls:

    • A or a - Move car left
    • D or d - Move car right
    • Avoid enemy cars falling from above!
  4. Scoring:

    • Earn points for each enemy car you successfully avoid
    • Try to beat your high score!
    • Scores are automatically saved to scores.txt
  5. Game Over:

    • Game ends when your car collides with an enemy
    • Your final score will be displayed
    • Option to play again or return to main menu

๐Ÿ“ Project Structure

Car_Game/
โ”œโ”€โ”€ ๐Ÿ“„ project.cpp              # Main game source code
โ”œโ”€โ”€ ๐Ÿ“„ README.md               # Project documentation
โ”œโ”€โ”€ ๐Ÿ“„ LICENSE                 # MIT License
โ”œโ”€โ”€ ๐Ÿ“„ CONTRIBUTING.md         # Contribution guidelines
โ”œโ”€โ”€ ๐Ÿ“„ Car-Game-Code.pptx      # Additional documentation
โ”œโ”€โ”€ ๐Ÿ“„ Documentation.pdf       # Project documentation
โ””โ”€โ”€ ๐Ÿ“„ scores.txt              # High scores file (generated)

Key Components in project.cpp:

  • Game Engine Functions:

    • main() - Entry point and menu system
    • play() - Main game loop
    • collision() - Collision detection logic
  • Graphics Functions:

    • drawCar() - Renders player car
    • drawEnemy() - Renders enemy vehicles
    • drawBorder() - Game area boundaries
    • gotoxy() - Console cursor positioning
  • Game Logic:

    • genEnemy() - Enemy spawning system
    • updateScore() - Score management
    • saveScoreToFile() - Score persistence

๐Ÿค Contributing

We welcome contributions from the community! Please read our Contributing Guidelines for details on:

  • How to submit bug reports
  • How to suggest new features
  • Code style and standards
  • Pull request process

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ—บ๏ธ Roadmap

โœ… Current Features

  • Basic car movement and controls
  • Enemy car spawning and movement
  • Collision detection
  • Score tracking and persistence
  • Menu system with instructions and rankings

๐Ÿš€ Planned Features

  • Enhanced Graphics - Improved ASCII art and animations
  • Power-ups - Speed boost, invincibility, extra lives
  • Multiple Difficulty Levels - Easy, Medium, Hard modes
  • Sound Effects - Basic console beeps for actions
  • Multiplayer Support - Local two-player mode
  • Statistics - Detailed game statistics and analytics

๐Ÿ”ฎ Future Vision

  • Cross-platform Support - Linux and macOS compatibility
  • GUI Version - Modern graphics using SDL or SFML
  • Online Leaderboards - Global high score competition
  • Theme System - Different visual themes and car designs
  • Mobile Port - Android/iOS version

๐Ÿ™ Acknowledgments

  • Game Design Inspiration - Classic arcade racing games
  • ASCII Art - Retro gaming community
  • Windows Console API - Microsoft documentation and examples
  • C++ Community - For excellent resources and tutorials
  • Open Source Contributors - Everyone who helps improve this project

๐Ÿ› ๏ธ Tech Stack Details

This project leverages several key technologies:

  • C++ Standard Library - Core functionality and data structures
  • Windows Console API - For graphics rendering and input handling
  • File I/O Operations - Score persistence and data management
  • Memory Management - Efficient resource utilization
  • Object-Oriented Design - Clean, maintainable code structure

Made with โค๏ธ by H0NEYP0T-466

โญ Star this repo if you enjoyed the game! โญ

About

"๐Ÿš— Console-based Car Racing Game in C++ ๐ŸŽฎ Dodge enemy cars ๐ŸŽ๏ธ earn points ๐Ÿ“ˆ and climb the rankings ๐Ÿ†! Features smooth controls โŒจ๏ธ ASCII graphics ๐ŸŽจ collision detection ๐Ÿ’ฅ persistent high scores ๐Ÿ’พ and endless gameplay ๐Ÿ”„. A retro arcade-style challenge for racing fans โšก๐Ÿ”ฅ"

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages