Search This Blog

Showing posts with label arrow keys. Show all posts
Showing posts with label arrow keys. Show all posts

Keyboard Controlled Car Animation in C - Computer Graphics Lab Program

This is a computer graphics lab program. This is an animation program in which a car can be moved using the arrow keys on keyboard. The car should move forward when right arrow key is pressed and backward when left arrow key is pressed. The car accelerates as the right arrow key is pressed. When it is released the car decelerates. The program uses the graphics library graphics.h. This program works well in the turbo c compiler with Borland graphics interface (BGI). The output of the program is as follows:

The program is as follows: