I developed this game as a part of my winter project in class 11th. In this game the user controls his car (green) with the left and right arrow keys and has to dodge the obstacles (opponent cars in blue) which are descending randomly (in two columns) on the screen. This game has several levels and with the increase in each level the speed of the game increases until there is a winner!
Below are some of the screen captures during an actual gameplay:
Screenshot 1 | Screenshot 2 |
---|---|
![]() |
![]() |
- The biggest challenge was to give a grapical display without using Graphics.h library. So I overcame this problem by using the ASCII values then used them creatively to give the shape of a car and the background as the road.
- The second was to switch between the continuous operation :-
- The movement of the obstacles
- The switch between the left and right position on te user end
- so I overcame this by using if-else contruct and kbhit() function which allowed the user to switch quickly without counting the key press (even for long time) as several inputs.
Just download the .CPP file and you can compile and run the code on TurboC++ or TurboC
Vatsal Aggarwal