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#.
- 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.
- 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.
-
Clone the repository:
git clone https://github.com/yourusername/DrivingGame.git
-
Open the project in your preferred C# development environment (e.g., Visual Studio, Visual Studio Code).
-
Build and run the project.
- 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.
Contributions are welcome! If you have suggestions for improvements or new features, feel free to create an issue or submit a pull request.
This project is licensed under the MIT License.
- This project was inspired by classic arcade driving games and is a demonstration of basic game development concepts in C#.
If you have any questions or feedback, feel free to reach out at jdharris7@cougars.ccis.edu.
Enjoy the game!