CG - Mini Project - Report
CG - Mini Project - Report
BELGAVI
Submitted by:
MEGHANA K (1JS18CS080)
AND
PRAGATHI M R(1JS18CS107)
CERTIFICATE
This is to certify that the Mini-Project on Computer Graphics and Visualization
work entitled “Aeroplane Game” has been successfully carried out by Meghana
K (1JS18CS080) and Pragathi M R(1JS18CS107) a bonafide students of JSS
Academy of Technical Education in partial fulfilment of the requirements for
the award of degree in Bachelor of Engineering in Computer Science and
Engineering of Visvesvaraya Technological University, Belgaum during
academic year 2020-2021. It is certified that all corrections/suggestions
indicated for Internal Assessment have been incorporated in the report
deposited in the departmental library. The mini project report has been approved as
it satisfies the academic requirements in respect of project work for the said degree.
We express our humble pranams to His Holiness Jagadguru Sri Sri Sri Shivaratri
Deshikendra Mahaswamiji for showering his blessings on us to receive good
education and have a successful career.
The completion of any project involves the efforts of many people. We have been lucky
enough to have received a lot of support from all ends during the course of this project.
So, we take this opportunity to express our gratitude to all whose guidance and
encouragement helped us emerge successful.
We are thankful for the resourceful guidance, timely assistance and graceful gesture of
our guide Mr. Vikhyath K B and Mr. Sharan, Assistant professor, Department of
Computer Science and Engineering, who helped us in every aspect of our project work.
We are also forever grateful to Dr. Naveen N. C., Head of the Department, Computer
Science and Engineering, for his unending support, guidance and encouragements in all
our ventures.
We express our sincere thanks to our beloved principal, Dr. Mrityunjaya V. Latte for
having supported us in all our academic endeavors.
Last but not the least; we would be immensely pleased to express our heartfelt thanks to
all the teaching and non-teaching staff of the department of CSE and our friends for
their timely help, support and guidance.
Meghana K (1JS18CS080)
Pragathi M (1JS18CS107)
ABSTRACT
The main theme of this project is to display the Aeroplane flying from one end to
another end or to reach the destination successfully with basic computer graphics.
This graphics package is based on the OpenGL library functions. The
programming language used here is C using OpenGL libraries.
In this game an Aeroplane flying from one end to another end and reach the
destination successfully by crossing all the obstacles which occur in the path of the
plane, the player has to control the plane upwards and downwards using the
keyboard to avoid the collision with obstacles.
This game consists of three levels in each level the speed of the plane as well as
the speed of the obstacles going to increase, if a collision occurs between plane and
obstacles then the game will be over. And in the end, it will show us the number of
levels successfully completed by the player.
TABLE OF CONTENTS
CHAPTER NO. CHAPTER NAME PAGE NO.
1. INTRODUCTION .....................................1
1.1 Introduction To OpenGL.................................... 1
1.2 Computer Graphics............................................. 1
1.3 A Brief History of OpenGL ................................. 2
1.3.1 What is OpenGL ..................................... 3
1.3.2 Programming using OpenGL………...4
1.4 OpenGL(Open Graphics Library)………….……4
2 REQUIREMENT SPECIFICATION……...5
2. 1 Hardware Requirements……………………………5
2. 2 Software Requirements………………………….5
3 SYSTEM DESIGN………………………..6
3.1 System Architecture…………………………….6
4 IMPLEMENTATION…………………….7
4.1 Implementation of OpenGL Built in functions used…..7
4. 2 Implementation of User Defined functions……..9
5 SNAPSHOTS……………………………11
5.1 Introduction………………………………………11
5.2 Menu…………………………………………….12
5.3 Moving Aeroplane…………………………….13
5.4 level completed…………………………………….13
5.5 Game over…………………………………………16
5.6 All levels Completion…………………………….16
6 FUCTURE ENHANCEMENT…………....…15
References…………………………………………...16
Appendix A.1:Source code…………………………..17
A.2: User Manual…………………………31
Aero-plane Game
CHAPTER 1
INTRODUCTION
The Second is concerned with the storage and transmission of data between
graphics manufacturing systems. The current standard in this area is the
Initial Graphics Exchange Specification (IGES).
A computer graphics system is a computer system with all the components of the
general purpose computer system. There are five major elements in system: input
devices, processor, memory, frame buffer, output devices.
OpenGL was developed by Silicon Graphics and is popular in the video games
industry where it competes with Direct3D on Microsoft Windows IrisGL, a
proprietary graphics API, is the precursor of OpenGL. It is developed by Silicon
Graphics Inc. (SGI). IrisGL was used as the starting point of an open standard for
computer graphics that would save time porting applications by avoiding direct
hardware access. After SGI cleaned up IrisGL and opened up the standard to other
companies, OpenGL was born.
In 1992 the OpenGL Architectural Review Board (OpenGL ARB) was established.
The OpenGL ARB is a group of companies that maintain and update the OpenGL
standard.
In 2003 the first OpenGL (Exchange Specification) ES specification was released.
OpenGL ES is a subset of OpenGL designed for mobile phones, embedded devices and
video game systems.
In 2004 the OpenGL 2.0 specification was released, including the GLSL (OpenGL
Shading).
1.3.1. WHAT IS OPEN-GL?
Operations
Specify camera, light, color, texture information, etc.
No windowing or (platform-specific) input/interaction
functions— these are the jobs of GLUT
Apply geometric transformations.
Specify geometric primitives (lines, pixels, polygons ...)
OpenGL provides a powerful but primitive set of rendering commands, and all
higher-level drawing must be done in terms of these commands. Also, OpenGL
programs have to use the underlying mechanisms of the windowing system.
A number of libraries exist to allow you to simplify your programming tasks,
including the following:
The OpenGL Utility Library (GLU) contains several routines that use lower-
level OpenGL commands to perform such tasks as setting up matrices for
[CSE, JSSATE] 2020-21 Page 4
Aero-plane Game
specific viewing orientations and projections, performing polygon tessellation,
and rendering surfaces. GLU routines use the prefix glu.
The OpenGL Utility Toolkit (GLUT) is a window system-independent
toolkit, written by Mark Kilgard, to hide the complexities of differing
window system APIs.
GLUT is the subject of the next section, and it’s described in more detail in
Mark Kilgard’s book OpenGL Programming for the X Window System
(ISBN 0-201-48359-9).
GLUT routines use the prefix glut. "How to Obtain the Sample Code" in the
Preface describes how to obtain the source code for GLUT, using ftp.
CHAPTER 2
REQUIREMENTS SPECIFICATION
CHAPTER 3
SYSTEM DESIGN
Design of any software depends on the architecture of the machine on which that
software runs, for which the designer needs to know the system architecture. Design
process involves design of suitable algorithms, modules, subsystems, interfaces etc.
CHAPTER 4
IMPLEMENTATION
1. glutInit():
glutInit is used to initialize the GLUT Library.
Usage: void glutInit(int *argcp, char **argv);
Description: glutInit will initialize the GLUT library and negotiate a session
with the window system.
2. glutInitDisplayMode():
glutInitDisplayMode sets the initial display mode.
Usage: void glutInitDisplayMode(unsigned int mode);
Mode-Display mode, normally the bitwise OR-ing of GLUT display mode bit
masks.
Description: The initial display mode is used when creating top-level
windows, sub windows, and overlays to determine the OpenGL display mode
for the to-be-created window or overlay.
3. glutCreateWindow():
It creates top level window.
Usage: int glutCreateWindow(char *name);
Name - ASCII character string for use as window name.
Description: glutCreateWindow creates a top-level window. The name will
be provided to the window system as the window's name. The intent is that
the window system will label the window with the name. Implicitly, the
current window is set to the newly created window. Each created window
has a unique associated OpenGL context.
[CSE, JSSATE] 2020-21 Page 7
Aero-plane Game
4. glutDisplayFunc():
glutDisplayFunc sets the display callback for the current window.
Usage: void glutDisplayFunc(void (*func)(void));
Func – The new display callback function.
Description: glutDisplayFunc sets the display callback for the current
window. When GLUT determines that the normal plane for the window
needs to be redisplayed, the display callback for the window is called. Before
the callback, the current window is set to the window needing to be
redisplayed and the layer in use is set to the normal plane. The display
callback is called with no parameters. The entire normal plane region should
be redisplayed in response to the callback.
5. glutMainLoop():
glutMainLoop() enters the GLUT event processing loop.
Usage: void glutMainLoop(void);
Description: glutMainLoop enters the GLUT event processing loop. This
routine should be called at most once in a GLUT program. Once called,
this routine will never return. It will call as necessary any callbacks that
have been registered.
6. glMatrixMode( ):
The two most important matrices are the model-view and projection matrix. At
any time, the state includes values for both of these matrices, which are initially set
to identity matrices. There is only a single set of functions that can be applied to
any type of matrix. Select the matrix to which the operations apply by first set in
the matrix mode, a variable that is set to one type of matrix and is also part of the
state.
7. glutTimerFunc();
Here the initialization function init() is used to set the OpenGL state variables
dealing with viewing and attributes-parameters that is prefered to set once,
independently of the display function.
2. void plane():
Here the function plane() is used to draw the elements of plane it basically uses
OpenGL glVertex() having ‘x’ and ‘y’ attributes specifying ‘x’ and ‘y’ co-ordinate
position respectively and we use glColor3f() to give color to the plane.
3. void obstacles():
Basically this function is used to draw blocks on the Screen by calling glVertex()
function and we use glColor3f() to give color to the blocks.
4. void mov():
This function contains the logic for the movement of planes and obstacles. we use
some of flags to implement it. This also contains the logic for collision between
plane and obstacle.
5. void moveup(void):
This function is used to move the aeroplane upwards. Here we have used
glLoadIdentity() function.
CSE, JSSATE 2020-21 Page 9
Aero-plane Game
6.void movedown(void):
This function is used to move the aeroplane upwards. Here we have used
glLoadIdentity() function.
8. void screen():
This functions is used to style main page of our game. This page contains
drawstring() and glColor3f() function .
8.msg(),msg1(),msg2(),msg3():
These function gives “LEVEL COMPLETED", "GAME OVER RETRY",
"Player completed 1 level", "Player completed 2 level" respectively. These
contains drawstring() and glColor3f() function .
9.Display():
In this function we have used the flag and depending on the flag the corresponding
frame is displayed on the screen.
CHAPTER 5
SNAPSHOTS
By pressing ‘a’ we can start the game and also resume the movement of blocks.
By pressing ‘w’ for moving aeroplane upwards.
By pressing ‘s’ for moving aeroplane downwards.
By pressing ‘m’ we can stop movement of blocks.
By pressing ‘l’ or ’L’ we can go to next level.
By pressing ‘e’ to exit.
CHAPTER 6
FUTURE ENHANCEMENT
We have implemented the essential features of collision in Aeroplane Game of our best
knowledge. Even still, we would like to enhance the quality and appearance of the
game in the following ways:
3D View
Design of Aeroplane
Lighting and shading
Background modification and speed modification
REFERENCES
Books:
Computer Graphics with OpenGL Version,3rd Edition, Donald Hearn &
Pauline Baker
Interactive Computer Graphics-A Top Down approach with OpenGL,5rd
Edition,Edward Angel
Websites:
1. http://www.amazon.in/Computer-Graphics-
Multimedia-Udit-
Agarwal/dp/935014316X?tag=googinhydr18418-
21
2. http://en.wikipedia.org/wiki/Computer_graphics
3. http://stackoverflow.com/questionsquickly
4. http://www.opengl-tutorial.org/intermediate-tutorials/
5. http://www.opengl-tutorial.org/
6. https://open.gl/
7. http://www.cs.uccs.edu/~ssemwal/indexGLTutorial.html
8. http://www.videotutorialsrock.com/
9. http://ogldev.atspace.co.uk/
10. https://www.opengl.org/sdk/docs/tutorials/
11. http://learnopengl.com/
12. http://lazyfoo.net/tutorials/OpenGL/
13. http://en.wikibooks.org/wiki/OpenGL_Programming
14. https://youtu.be/khergS0bZIk
drawstring(346,460,0,"USN");
glColor3f(1.0,1.0,1.2);
drawstring(180,420,0.0,"MEGHANA K");
drawstring(340,420,0,"1JS18CS080");
drawstring(180,370,0.0,"PRAGATHI M R");
drawstring(340,370,0.0,"1JS18CS107");
glColor3f(1.0,0.0,1.0);
drawstring(450,460,0.0,"Key");
drawstring(500,460,0,"Description");
glColor3f(1.0,1.0,1.2);
drawstring(450,420,0.0,"a");
drawstring(500,420,0,"To start the game ");
drawstring(450,370,0.0,"w");
drawstring(500,370,0.0,"To move up");
drawstring(450,320,0.0,"s");
drawstring(500,320,0,"To move down");
drawstring(450,270,0.0,"m");
drawstring(500,270,0.0,"To stop movement of blocks");
drawstring(450,230,0.0,"a");
drawstring(500,230,0.0,"To start movement of blocks");
drawstring(450,190,0.0,"L");
drawstring(500,190,0.0,"Next level");
drawstring(450,140,0.0,"e");
drawstring(500,270,0.0,"To exit");
glColor3f(1.0,0.0,1.0);
drawstring(240,310,0.0,"UNDER THE GUIDENCE OF");
glColor3f(1.0,1.0,1.2);
drawstring(260,270,0.0,"Prof: VIKHYATH K
B"); drawstring(260,230,0.0,"Prof: SHARAN");
glColor3f(0.0,0.8,1.0);
drawstring(175,130,0.0,"DEPARTMENT OF COMPUTER SCIENCE AND
ENGINEERING");
drawstring(240,80,0.0,"ACADEMIC YEAR: 2020-2021");
glColor3f(rand()%2,rand()%3,rand()%2);
drawstring(245,35,0.0,"Press 'a' to start the game");
glFlush();
}
void msg()
{
glColor3f(1.0,0.2,0.0);
drawstring(250,300,0.0,"CONGRATULATIONS");
drawstring(250,250,0.0,"LEVEL COMPLETED");
drawstring(250,200,0.0,"Press 'L' to start Next Level");
}
void msg1()
{
glColor3f(1.0,0.6,0.6);
drawstring(250,300,0.0,"GAME OVER RETRY");
drawstring(250,270,0.0,"PRESS 'e' TO EXIT");
}
void msg2()
{
glColor3f(1.0,0.6,0.6);
drawstring(250,320,0.0,"GAME OVER");
drawstring(250,280,0.0,"Player completed 1 level");
drawstring(250,250,0.0,"PRESS 'e' TO EXIT");
}
void msg3()
{
glColor3f(1.0,0.6,0.6);
drawstring(250,320,0.0,"GAME OVER");
drawstring(250,280,0.0,"Player completed 2 level");
drawstring(250,250,0.0,"PRESS 'e' TO EXIT");
}
void plane()
{
glColor3f(1.0,0.5,0.0);
glBegin(GL_POLYGON);
glVertex2f(a,a1);
glVertex2f(b,b1);
glVertex2f(c,c1);
glEnd();
glColor3f(0.5,0.5,1.0);
glBegin(GL_POLYGON);
glVertex2f(c,c1);
glVertex2f(d,d1);
glVertex2f(e,e1);
CSE, JSSATE 2020-21 Page 19
Aero-plane Game
glVertex2f(f,f1);
glVertex2f(b,b1);
glEnd();
glColor3f(0.6,0.0,0.0);
glBegin(GL_TRIANGLE_STRIP);
glVertex2f(g,g1);
glVertex2f(i,i1);
glVertex2f(h,h1);
glEnd();
glColor3f(0.6,0.0,0.0);
glBegin(GL_TRIANGLE_STRIP);
glVertex2f(j,p1);
glVertex2f(l,l1);
glVertex2f(k,k1);
glEnd();
glColor3f(1.0,0.5,0.0);
glBegin(GL_POLYGON);
glVertex2f(a,d1);
glVertex2f(b,b1);
glVertex2f(c,f1);
glEnd();
glutPostRedisplay();
}
void obstacle()
{
glColor3f(rand()%100,0.44,rand()%50);
glBegin(GL_POLYGON);
glVertex2f(x11,y11);
glVertex2f(x12,y11);
glVertex2f(x12,y12);
glVertex2f(x11,y12);
glEnd();
glColor3f(rand()%100,rand()%50,0.65);
glBegin(GL_POLYGON);
glVertex2f(x13,y13);
glVertex2f(x14,y13);
glVertex2f(x14,y14);
glVertex2f(x13,y14);
glEnd();
glColor3f(0.7,rand()%100,rand()%200);
CSE, JSSATE 2020-21 Page 20
Aero-plane Game
glBegin(GL_POLYGON);
glVertex2f(x15,y15);
glVertex2f(x16,y15);
glVertex2f(x16,y16);
glVertex2f(x15,y16);
glEnd();
glColor3f(rand()%60,0.6,rand()%100);
glBegin(GL_POLYGON);
glVertex2f(x17,y17);
glVertex2f(x18,y17);
glVertex2f(x18,y18);
glVertex2f(x17,y18);
glEnd();
glColor3f(rand()%70,rand()%200,rand()%300);
glBegin(GL_POLYGON);
glVertex2f(x19,y19);
glVertex2f(x20,y19);
glVertex2f(x20,y20);
glVertex2f(x19,y20);
glEnd();
glColor3f(rand()%70,rand()%200,rand()%300);
glBegin(GL_POLYGON);
glVertex2f(x21,y21);
glVertex2f(x22,y21);
glVertex2f(x22,y22);
glVertex2f(x21,y22);
glEnd();
glutPostRedisplay();
void moveup(void)
{
glLoadIdentity();
a1=a1+20;
b1=b1+20;
c1=c1+20;
d1=d1+20;
e1=e1+20;
CSE, JSSATE 2020-21 Page 21
Aero-plane Game
f1=f1+20;
g1=g1+20;
h1=h1+20;
i1=i1+20;
p1=p1+20;
k1=k1+20;
l1=l1+20;
if(a1>600)
flag2=1;
glutPostRedisplay();
}
void movedown(void)
{
glLoadIdentity();
a1=a1-20;
b1=b1-20;
c1=c1-20;
d1=d1-20;
e1=e1-20;
f1=f1-20;
g1=g1-20;
h1=h1-20;
i1=i1-20;
p1=p1-20;
k1=k1-20;
l1=l1-20;
if(b1<0||f1<0)
flag2=1;
glutPostRedisplay();
}
case 'w':
if(k=='w')
moveup();
break;
CSE, JSSATE 2020-21 Page 22
Aero-plane Game
void mov()
{ //PLANE MOV
if(flag1==1)
{
if(a<600||b<600||c<600||d<600||e<600||f<600||g<600||h<600||i<600||j<600||k<600||l<600)
{
a=a+sp3;
b=b+sp3;
c=c+sp3;
d=d+sp3;
e=e+sp3;
f=f+sp3;
g=g+sp3;
h=h+sp3;
i=i+sp3;
j=j+sp3;
k=k+sp3;
l=l+sp3;
}
CSE, JSSATE 2020-21 Page 23
Aero-plane Game
//OBSTACLE MOV
if(flag6!=1)
{
if(x11>=0||x12>=0)
{
x11=x11-sp1;
x12=x12-sp1;
}
else
{
x11=600;
x12=610;
if(y11<590)
{
y11=y11+40;
y12=y12+40;
}
else
{
y11=270;
y12=290;
}
}
if(x13>=0||x14>=0)
{
x13=x13-sp2;
x14=x14-sp2;
}
else
{
x13=600;
x14=620;
if(y13<590)
{
y13=y13+40;
y14=y14+40;
}
else
{
y13=230;
y14=250;
}
}
if(x15>=0||x16>=0)
{
x15=x15-sp1;
x16=x16-sp1;
}
else
{
x15=590;
x16=600;
if(y15<610)
{
y15+=40;
y16+=40;
}
else
{
y15=330;
y16=350;
}
}
if(x17>=0||x18>=0)
{
x17=x17-sp1;
x18=x18-sp1;
}
else
{
x17=650;
x18=660;
if(y17<610)
{
y17+=40;
y18+=40;
}
else
{
CSE, JSSATE 2020-21 Page 25
Aero-plane Game
y17=230;
y18=250;
}
}
if(x19>=0||x20>=0)
{
x19=x19-sp2;
x20=x20-sp2;
}
else
{
x19=580;
x20=600;
if(y19<570)
{
y19+=40;
y20+=40;
}
else
{
y19=170;
y20=190;
}
}
if(x21>=0||x22>=0)
{
x21=x21-sp2;
x22=x22-sp2;
}
else
{
x21=580;
x22=600;
if(y21<610)
{
y21+=40;
y22+=40;
}
else
{
CSE, JSSATE 2020-21 Page 26
Aero-plane Game
y21=170;y22=190;
}
//COLISSION
if((d>x11&&d1==y12&&d<x12)||(f>x11&&f1==y11&&f<x12)||(d>x11&&d1==y11&&d<x12
)||(f>x11&&f1==y12&&f<x12)||(c>x11&&c1==y12&&c<x12)||(b>x11&&b1==y12&&b<x12)||(c>x
11&&c1==y11&&c<x12)||(b>x11&&b1==y12&&b<x12)||(a>x11&&a1==y11&&a<x12))
flag2=1;
else
if((d>x13&&d1==y14&&d<x14)||(f>x13&&f1==y13&&f<x14)||(d>x13&&d1==y13&&d<x14)||(f>x
13&&f1==y14&&f<x14)||(c>x13&&c1==y14&&c<x14)||(b>x13&&b1==y14&&b<x14)||(c>x13&&
c1==y13&&c<x14)||(b>x13&&b1==y13&&b<x14)||(a>x13&&a1==y13&&a<x14))
flag2=1;
else
if((d>x15&&d1==y16&&d<x16)||(f>x15&&f1==y15&&f<x16)||(d>x15&&d1==y15&&d<x16)||(f>x
15&&f1==y16&&f<x16)||(c>x15&&c1==y16&&c<x16)||(b>x15&&b1==y16&&b<x16)||(c>x15&&
c1==y15&&c<x16)||(b>x15&&b1==y15&&b<x16)||(a>x15&&a1==y15&&a<x16))
flag2=1;
else
if((d>x17&&d1==y18&&d<x18)||(f>x17&&f1==y17&&f<x18)||(d>x17&&d1==y17&&d<x18)||(f>x
17&&f1==y18&&f<x18)||(c>x17&&c1==y18&&c<x18)||(b>x17&&b1==y18&&b<x18)||(c>x17&&
c1==y17&&c<x18)||(b>x17&&b1==y17&&b<x18)||(a>x17&&a1==y17&&a<x18))
flag2=1;
else
if((d>x19&&d1==y20&&d<x20)||(f>x19&&f1==y19&&f<x20)||(d>x19&&d1==y19&&d<x20)||(f>x
19&&f1==y20&&f<x20)||(c<x19&&c1==y20&&c>x20)||(b>x19&&b1==y20&&b<x20)||(c>x19&&
c1==y19&&c<x20)||(b>x19&&b1==y19&&b<x20)||(a>x19&&a1==y19&&a<x20))
flag2=1;
else
if((d>x21&&d1==y21&&d<x22)||(f>x21&&f1==y21&&f<x22)||(d>x21&&d1==y21&&d<x22)||(f>x
21&&f1==y22&&f<x22)||(c<x21&&c1==y22&&c>x22)||(b>x21&&b1==y22&&b<x20)||(c>x21&&
c1==y22&&c<x22)||(b>x21&&b1==y21&&b<x22)||(a>x21&&a1==y21&&a<x22))
flag2=1;
if(a>=600)
{
sp3=sp3+0.03125;
sp1=sp1+0.07;
sp2=sp2+0.08;
if(sp3>0.125)
{
flag4=1;
}
a=0,b=5;c=10;d=40;e=45;f=40;g=15;h=20;i=15,j=15,k=20,l=15;
a1=310;b1=270;c1=290;d1=290;e1=280;f1=270;g1=290;h1=290;i1=310,p1=270,k1=270,l1=250;
x11=470;x12=480;x13=520;x14=540;x15=590;x16=600;x17=650;x18=660;x19=610;x20=630,
x21=580;x22=600;
y11=270;y12=290;y13=230;y14=250;y15=330;y16=350;y17=450;y18=470;y19=490;y20=510;
y21=170;y22=190;
flag3=0;
flag5=0;
}
}
glutPostRedisplay();
}
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glClearColor(0.0,0.0,0.0,0.0);
if(flag==0)
{
screen();
}
if(flag1==1)
{
plane();
obstacle();
}
if(flag2==1&&sp3==0.0625)
{
flag1=0;
msg1();
}
if(flag2==1&&sp3==0.09375)
{
flag1=0;
msg2();
}
if(flag2==1&&sp3==0.125)
{
flag1=0;
msg3();
}
if(flag5==0)
{
flag1=0;
msg();
flag3=1;
}
if(flag4==1)
{
flag=1;
flag1=0;
flag2=0;
flag5=1;
drawstring(250,330,0.0,"Congrats");
drawstring(210,300,0.0,"Player Completes All 3 Levels");
}
glFlush(); }
int main (int argc,char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(1366, 400);
glutInitWindowPosition(0,0);
glutCreateWindow("plane");
init();
glutDisplayFunc(display);
glutIdleFunc(mov);
glutKeyboardFunc(key);
glutMainLoop();
return 0;
}