“Moving Bus Animation” is a simple animation made for the representation of moving bus with C programming language. On the first day, when I learnt about graphics, this idea suddenly hit my mind, and I thought why not to give it a try. With use of simple concept logic finally I was able to build this project.
How to download source code?
- Click here for source code.
- New window will open where there is a source code of this project. Download all the files present there.
- Remember to run this project in Dev C++.
Demo of the game
Check out the following video for the demo of this project.
For more source code and tutorial, SUBSCRBE to my YouTube channel.
Development platform
Computer programming language has been used to develop this project.
Compiler
Dev C++ has been used as compiler. The compiler version that I used is 5.11.
Header files used
The header files used in this project are as follows :
- Conio
- Dos
- Graphics
Library functions
The following library functions has been used :
- Under conio header file
- Clrscr
- Getch
- Under dos header file
- Delay
- Under graphis header file
- Arc
- Circle
- Floodfill
- Initwindow
- Line
- Setfillstyle
- Setlinestyle
- Rectangle
Concepts used
Topics/ concepts of this language that you need to know for making this type of game :
- For loop
- Graphics
Logic description
The logic behind this project is pretty simple. To describe briefly, what we require is to draw different shapes as required. Remember those shape determining functions must be placed inside the loop.
Now, for each iteration of the loop, provide updated value to the shapes determining functions. We can use the variable use for the initialization of the loop.
It is necessary to hold the operation time of the loop. For that use delay function. I prefer using delay of 50 millisecond.
The most important thing you need to know for making this animation is “for each iteration of the for-loop, clear the previous screen”. The system(“cls”) function does not work for this. So, you need to use floodfill function.
Screenshots
Some of the screenshots related to this project are :
No comments:
Post a Comment