/ConsoleDrivingGame

Console App that simulates steering a vehicle to avoid coliding with other vehicles. If a player hits a vehicle the game ends.

Primary LanguageC#

DrivingGame

Overview

DrivingGame is a simple console-based game written in C#. The player controls a vehicle navigating through an endless road filled with other vehicles. The player's vehicle can move left and right, accelerate, and brake using the arrow keys. Random computer-controlled vehicles continuously appear at the top of the screen and move downward. The player's objective is to avoid collisions with these computer vehicles while maintaining control of their own speed and position.

This project demonstrates basic game mechanics, console graphics, and real-time input handling in C#.

How to Play

  • Use the Left Arrow key to move the player's vehicle left.
  • Use the Right Arrow key to move the player's vehicle right.
  • Use the Up Arrow key to accelerate the player's vehicle.
  • Use the Down Arrow key to brake the player's vehicle.
  • Avoid collisions with the computer-controlled vehicles that appear at the top of the screen and move downward.

Features

  • Player-controlled vehicle with the ability to move left, right, accelerate, and brake.
  • Randomly generated computer-controlled vehicles that move down the screen.
  • Collision detection between the player's vehicle and computer-controlled vehicles.
  • Real-time input handling and dynamic game speed based on the player's vehicle speed.

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/DrivingGame.git
  2. Open the project in your preferred C# development environment (e.g., Visual Studio, Visual Studio Code).

  3. Build and run the project.

Code Structure

  • Program.cs: Contains the main game loop and handles input, vehicle movement, collision detection, and rendering.
  • Vehicle.cs: Defines the Vehicle class with properties and methods for vehicle behavior, such as moving left, right, accelerating, braking, and displaying the vehicle.

Contribution

Contributions are welcome! If you have suggestions for improvements or new features, feel free to create an issue or submit a pull request.

License

This project is licensed under the MIT License.

Acknowledgements

  • This project was inspired by classic arcade driving games and is a demonstration of basic game development concepts in C#.

Contact

If you have any questions or feedback, feel free to reach out at jdharris7@cougars.ccis.edu.

Enjoy the game!