Professional Documents
Culture Documents
by
Gaurav Mishra(RollNo.9557)
Sumit Rai (Roll No. 9570)
Madhav Jha (Roll No. 9543)
Gaurav Joshi (Roll No. 9612)
Introduction:
- The animations used in this project are only using the graphics.h header file.
- The reason we chose this topic is because it covers most of the topics
covered in our syllabus and uses new functions which we got to learn and
implement.
Methodology:
The tools used for this project are MS turbo c complier.
The graphics.h library used in the BGI.
In this program, we first draw a fish on left side of the screen (x,y) and then
simulate it by moving it along X direction. We make the fish to simulate along the
screen and finally out of the screen. This will look like a fish moving from the right to
left direction. We will repeat above steps until fish reaches the right side of screen.
Results:
Source code:
#include <stdio.h>
#include <graphics.h>
#include <conio.h>
#include <dos.h>
int main() {
int gd = DETECT, gm;
int i, maxx, midy;
midy = getmaxy()/2;
cleardevice();
setcolor(WHITE);
line(0, midy + 37, maxx, midy + 37);
setcolor(YELLOW);
setfillstyle(SOLID_FILL, RED);
delay(100);
}
getch();
closegraph();
return 0;
}
Conclusion:
Thus by choosing this project we learned and got to implement new functions
Particularly setfillstyle() and arc().
References:
www.techcrashcourse.com
Javatpoint