Moving Bus Animation - Using C Programming Language










“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 :

  1. Conio
  2. Dos
  3. Graphics

 

Library functions

The following library functions has been used :

  1. Under conio header file
    1. Clrscr
    2. Getch
  2. Under dos header file
    1. Delay
  3. Under graphis header file
    1. Arc
    2. Circle
    3. Floodfill
    4. Initwindow
    5. Line
    6. Setfillstyle
    7. Setlinestyle
    8. Rectangle

 

Concepts used

Topics/ concepts of this language that you need to know for making this type of game :

  1. For loop
  2. 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

Article Ad1