0% found this document useful (0 votes)
5 views

Airplane Game Management System Project Report

This document is an internship report on the Airplane Game Management System, detailing the development of a collision evasion game where users control a plane to avoid obstacles. It discusses the use of OpenGL for graphics rendering, the requirements for software and hardware, and the implementation of various functions to manage game mechanics. The report includes sections on introduction, requirements analysis, OpenGL functions, implementation, results, future enhancements, and conclusions.

Uploaded by

Kamal Acharya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Airplane Game Management System Project Report

This document is an internship report on the Airplane Game Management System, detailing the development of a collision evasion game where users control a plane to avoid obstacles. It discusses the use of OpenGL for graphics rendering, the requirements for software and hardware, and the implementation of various functions to manage game mechanics. The report includes sections on introduction, requirements analysis, OpenGL functions, implementation, results, future enhancements, and conclusions.

Uploaded by

Kamal Acharya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/383399489

AN INTERNSHIP REPORT ON AIRPLANE GAME MANAGEMENT SYSTEM


PROJECT REPORT.

Research Proposal · January 2024


DOI: 10.13140/RG.2.2.34738.41925

CITATIONS READS

0 24

1 author:

Kamal Acharya
Tribhuvan University
248 PUBLICATIONS 4,437 CITATIONS

SEE PROFILE

All content following this page was uploaded by Kamal Acharya on 25 August 2024.

The user has requested enhancement of the downloaded file.


AN that no part of the plane touches either the clouds or the buildings. The
INTERNSHIP REPORT plane is also equipped with a booster which the user can activate with the
right mouse button. The booster makes the plane travel at a faster pace.
ON The booster gets depleted when being used and replenishes gradually
AIRPLANE GAME MANAGEMENT SYSTEM PROJECT
when not used. At any instance the user can pause the game by pressing
”p” on the keyboard. Pressing the key again will resume the game. The
BY library glut.h is utilized in the implementation of the game as it provides
a wide range of options to draw the necessary shapes.
KAMAL ACHARYA
Keywords :Computer programming, Project management, Computer engineering
(Tribhuvan University)

Date: 2024/01/23

ABSTRACT
Graphics provides one of the most natural means of communicating with a
computer, since our highly developed 2D and 3D pattern recognition
allow us to perceive and process pictorialdata rapidly and efficiently.
Interactive computer graphics is the most important means of producing the
pictures since the invention of photography and television. It has the added
advantage that with the computer we can make pictures not only of concrete
real world objects but also of abstract such as survey results.

This project is a collision evasion process implemented in the form


of a game. Here the user is allowed to control the movement of the plane
through a collision course. The objective is to evade the obstacles and
travel as far as possible. The plane’s upward movement is controlled by
the left mouse button. Holding and pressing the left mouse button takes
the plane higher and releasing the button results in the plane descending
down. As the distance covered increases the speed of the plane increases.
The main obstacles are buildings and clouds. The user must make sure
CHAPTER 1 INTRODUCTION
CONTENTS

CHAPTER TITLE PAGE 1.1 Introduction to Computer Graphics


NO
Before the invention of computer graphics people used to display the
information manually either by drawing or creating model which resembles
1 Introduction 1 real environment. For example the Greeks were able to convey their
architectural ideas graphically using drawing. Today the same type of
information is generated by architects, mechanical engineers and draftsman
2 Requirement Analysis 5 using computer based graphics system.

Our interaction with computers has become dominated by a visual paradigm


that includes windows, icons, menus and a pointing device, such as a
3 OpenGL Functions 6 mouse. From a user’s Perspective, windowing system such as the X
windows system, Microsoft’s Windows. Although we are familiar with the
style of graphical user interface used on most workstations, advances in
4 Implementation 12 computer graphics have made possible other forms of interfaces.

5 Results and Snapshots 34

6 Future Enhancement 37

7 Conclusion 38 Fig 1.1 A Graphics System

Bibliography 39
1.2 OpenGL supports two classes of primitives:
1.5 Introduction to OpenGL API 1 Geometric primitives
OpenGL’s structure is similar to that of most 2 Image or raster primitives
Geometric primitive are specified in the problem domain and include
modern API’s any effort that you put into learning OpenGL will points, line segments, polygons, curves, and surfaces. Raster primitives
carry over to other software systems. OpenGL is easy to learn are those which are displayed using array of pixels, it is difficult to
manipulate raster primitive objects.
compared with other API’s, it support two and three dimensional
programs that we develop. OpenGL provides the programmer with OpenGL provide various viewing function that helps us to develop
various views of single object, and the way in which it appears on
an interface to graphics hardware. It is a powerful, low- level screen. OpenGL default view is the orthographic projection. OpenGL
rendering and modeling software library, available on all major also provide various transformation functions with the help of these
functions user can render its object at the desired location on the screen.
platforms, with wide hardware support. In OpenGL we obtain viewing and modeling functionality through a
small set of transformation functions. We can even rotate the object
Most of our applications will be designed to access along desired locations and with the desired angle on the screen.
OpenGL directly through functions in three libraries they are as
follows: 1.3 OpenGL
1. GLU
OpenGL provides a set of commands to render a three dimensional
2. GL scene. That means you provide the data in an OpenGL-useable form
and OpenGL will show this data on the screen (render it). It is
3. GLUT
developed by many companies and it is free to use.
The main GL libraries usually have function that
OpenGL is a hardware- and system-independent interface. An
begins with the letters gl. The OpenGL Utility Library (GLU) uses OpenGL-application will work on every platform, as long as there is an
gl functions but contains code for creating common objects and installed implementation. Because it is system independent, there are no
functions to create windows etc., but there are helper functions for each
simplifying viewing. To interface with the window system and to platform. A very useful thing is GLUT.
get input from external devices into our programs we need at least
one more library. For each major window system there is a system- 1.4 GLUT
specific library that provides the glue between the window system GLUT is a complete API written by Mark Kilgard which lets you create
windows and handle the messages. It exists for several platforms, that means
and OpenGL that library is OpenGL Utility Toolkit (GLUT).
that a program which uses GLUT can be compiled on many platforms without
(or at least with very few) changes in the code.
CHAPTER 2 REQUIREMENTS ANALYSIS
1.6 OpenGL architecture
OpenGL is a collection of several hundred functions providing access to all the 2.1 RESOURCE REQUIREMENTS
features offered by your graphics hardware. Internally, it acts as a state
machine--a collection of states that tells OpenGL what to do. Using the API, The requirement analysis phase of the project can be classified into:
you can set various aspects of the state machine, including such things as the  Software Requirements
current color, lighting, blending, and so on. When rendering, everything drawn  Hardware Requirements
is affected by the current settings of the state machine. It's important to be
aware of what the various states are, and the effect they have, because it's not SOFTWARE REQUIREMENTS:
uncommon to have unexpected results due to having one or more states set
incorrectly. At the core of OpenGL is the rendering pipeline as shown in
Figure. Input Requirement Standard Input Device :Keyboard, Mouse. Output
Requirement Standard Output Device : Color Monitor(60Hz) Software
Requirement Programming Language :C
Compiler Used : Visual C++ 2006/2008/2010/2012 Operating System :
Windows

HARDWARE REQUIREMENTS:
The hardware requirements are very minimal and the software can run on most
of the machines.
Fig 1.3 The OpenGL rendering pipeline
1. Main processor : Pentium 4
2. Processor Speed : 1000 MHz or More
1.1 How does OpenGL work? 3. RAM Size : 64 MB DDR or More
OpenGL bases on the state variables. There are many values, for example the 4. Keyboard : Standard QWERTY serial or PS/2 keyboard
color, that remain after being specified. There are no classes like in DirectX. 5. Mouse : Standard serial or PS/2 mouse
However, it is logically structured. 6. Compatibility : AT/T compatible
OpenGL provides its own data types. They all begin with "GL". For example- 7. Cache memory : 512 KB
GLfloat, GLint and so on. There are also many symbolic constants; they all
begin with "GL_", like GL_POINTS, GL_POLYGON.
3.1 Translation Functions
1. glTranslate
CHAPTER 3 OPENGL FUNCTIONS The glTranslated and glTranslatef functions multiply the current matrix by
the translation matrix.
3.3 Basic Functions
Void glTranslate(x, y, z) ;
1. glPushMatrix, glPopMatrix Function
Parameters
The glPushMatrix and glPopMatrix functions push and pop the current
x, y, z : The x, y, and z coordinates of a translation vector.
matrix stack. SYNTAX: void glPushMatrix();
void glPopMatrix(void); PARAMETERS: This function has no
2. glRotate
parameters.
The glRotated and glRotatef functions multiply the current matrix by a rotation
2. glColor3f Function
matrix. Void glRotate(Glfloat angle,Glfloat x,Glfloat y,Glfloat z);
Sets the current color.
Parameters
SYNTAX: void glColor3f(GLfloat red, GLfloat green, GLfloat blue);
angle : The angle of rotation, in degrees. X: The x coordinate of a vector.
Y: The y coordinate of a vector. Z: The z coordinate of a vector.
3. glBegin, glEnd Function
The glBegin and glEnd functions delimit the vertices of a primitive or a
group of like primitives. SYNTAX: void glBegin, glEnd (GLenum
mode);
PARAMETERS: mode
The primitive or primitives that will be created from vertices presented
between glBegin and the subsequent glEnd. The following are accepted
symbolic constants and their meanings: GL_LINES: Treats each pair of Fig 3.2 Vertex Transformation
vertices as an independent line segment. Vertices 2n - 1 and 2n define
line n. N/2 lines are drawn. 3.2 Functions Used To Display
GL_LINE_STRIP: Draws a connected group of 1. glClear Function
line segments from the first vertex to the last. The glClear function clears buffers to preset values.
Vertices n and n+1 define line n. N - 1 lines are drawn. SYNTAX: glClear(GLbitfield mask); PARAMETERS: mask
GL_LINE_LOOP: Draws a connected group of line segments from the Bitwise OR operators of masks that indicate the buffers to be cleared. The four
first vertex to the last, then back to the first. Vertices n and n + 1 define masks are as follows.
line n. The last line, however, is defined by vertices N and N lines are
drawn. Value Meaning
GL_TRIANGLES: Treats each triplet of vertices as an independent GL_COLOR_BUFFER_BIT The buffers currently enabled for
triangle. Vertices 3n -2, 3n - 1, and 3n define triangle n. N/3 triangle are color writing. GL_DEPTH_BUFFER_BIT The depth buffer.
drawn. glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
GL_QUADS: Treats each group of four vertices as an independent
quadrilateral. Vertices 4n - 3, 4n - 2, 4n - 1, and 4n defined quadrilateral 2. glMatrixMode Function
n. N/4 quadrilaterals are drawn. The glMatrixMode function specifies which matrix is the current matrix.
SYNTAX: void glMatrixMode(GLenum mode);
PARAMETERS: mode
The matrix stack that is the target for subsequent matrix operations. The mode
parameter can assume one of three values:
matrix stack. glMatrixMode(GL_MODELVIEW);
 mode
Value Meaning Display mode, normally the bitwise OR-ing of GLUT display mode bit masks. See
GL_MODELVIEW Applies subsequent matrix operations to the values below:
modelview GLUT_RGB: An alias for GLUT_RGBA.
matrix stack.
GLUT_DOUBLE: Bit mask to select a double buffered window. This overrides
glMatrixMode(GL_MODELVIEW); GLUT_SINGLE if it is also specified.
3. glLoadIdentity Function GLUT_DEPTH: Bit mask to select a window with a depth buffer.
The glLoadIdentity function replaces the current matrix with the identity
matrix. SYNTAX: void glLoadIdentity(void);
 glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
4. glutSwapBuffers
glutSwapBuffers swaps the buffers of the current window if double 2. glutInitWindowPosition, glutInitWindowSize Functions
buffered. SYNTAX: void glutSwapBuffers(void); glutInitWindowPosition and glutInitWindowSize set the initial window position
glutSwapBuffers(); and size
5. glOrtho . respectively.
SYNTAX: void glutInitWindowSize(int width, int height); void
 This function defines orthographic viewing volume with all parameters
glutInitWindowPosition(int x, int y);
measured from the centre of projection.
 multiply the current matrix by a perspective matrix. PARAMETERS:
SYNTAX: void glOrtho( GLdouble left, GLdouble right,
 width
GLdouble bottom, GLdouble top, GLdouble near,
Width in pixels.
GLdouble far)
 height
3.4 Functions Used To Reshape Height in pixels.
1. glutDisplayFunc Function  x
glutDisplayFunc sets the display callback for the current window. Window X location in pixels.
SYNTAX: void glutDisplayFunc(void (*func)(void));  y
PARAMETERS: Window Y location in pixels.
 func  glutInitWindowSize(300,300);
The new display callback function.
 glutDisplayFunc(display); 1. glutMainLoop Function
glutMainLoop enters the GLUT event processing loop. SYNTAX: void
3.5 Main Functions glutMainLoop(void);
3. glutInitDisplayMode Function  glutMainLoop(); glutStrokeCharacter
glutInitDisplayMode sets the initial display mode. SYNTAX: void
glutInitDisplayMode(unsigned int mode); PARAMETERS:
It renders the character with ASCII code char at the current raster position using CHAPTER 4 IMPLEMENTATION
the stoke font. SYNTAX: Void glutStrokeCharacter(void* font, int char)
PARAMETERS: Tools Used:
Font: GLUT_STROKE_MONO_ROMAN & GLUT_STROKE_ROMAN. OpenGL is an application program interface that is used to define 2D and 3D
3.6 Text Displaying Functions computer graphics. This cross-platform API is generally considered to set the
standard in the computer industry when it comes to this type of interaction
1. GlRasterPos with 2D computer graphics and has also become the usual tool for use with 3D
glRasterPos specify the raster position for pixel operations. graphics as well. Short for Open Graphics Library, OpenGL eliminated the
need for programmers to rewrite the graphics section of an operating system
Parameters each time a business would upgrade to a new version of the system.
x,y, z, w
The basic function of OpenGL is to issue a specific collection of executable or
Specify the x, y, z, and w object coordinates (if present) for the raster position. commands to the operating system. In doing so, the program works with the
2. glutBitmapCharacter existing graphics hardware that resides on the hard drive or other specified
source. Each command in the set is designed to engage a certain drawing
action, or launch a specific special effect associated with the graphics.
glutBitmapCharacter renders a bitmap character using OpenGL. Syntax: void
glutBitmapCharacter(void *font, int character); The available fonts are: 4.1 Implementation of User Defined Functions
GLUT_BITMAP_8_BY_13 GLUT_BITMAP_9_BY_15
GLUT_BITMAP_TIMES_ROMAN_10 GLUT_BITMAP_TIMES_ROMAN_24 User Defined Functions
The project contains several main user defined functions performing the
3.7 Interactive Functions essential tasks for implementing the game. They include:
 boundHit( ) : Checks if the plane exceeds the boundary. bool
glutKeyboardfunc FUNCTION boundHit()
Registers the keyboard callback function func. The callback function returns the {
ASCII code of the key pressed and the position of the mouse. if(plane_mvmt+50>=100||plane_mvmt+50 <=18) return true;
SYNTAX: void glutKeyboardFunc (void (*func) (unsigned char key, int x, int else
y)); return false;
}
 BuildingBlock( ) : Constructing the building. void buildingBlock()
{
b.block_x=50.0; srand(time(0)); b.no_floors = rand()%3+4; buildColor = rand()%3;
void glClearColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a):
b.block_y=b.no_floors*10 +15; b.state=true;
s.state=false;
Sets the present RGBA clear color used when clearing the color buffer.
}
Variables of GLclampf are floating-point numbers between 0.0 and 1.0.
 buildingHit( ) : Checking if the airplane has crashed into the building. bool int glutCeateWindow(char *title):
buildingHit()
{ Creates a window on the display. The string title can be used to label the
if (((int)b.block_x<=8 &&(int)b.block_x>=-7 && ((int)plane_mvmt+50)- window. The return value provides a reference to the window that can be
b.block_y<=3)) return true; used where there are multiple windows.
else if (((int)b.block_x<=10 &&(int)b.block_x>=-5 && void glutInitWindowSize(int width, int height):
((int)plane_mvmt+50)- b.block_y<=0))
return true; Specifies the initial height and width of the window in pixels.
else if(((int)b.block_x<=6 &&(int)b.block_x>=-3 &&
((int)plane_mvmt+47)- b.block_y<=0)) return true; void glutInitWindowPosition(int x, int y) :
else if(((int)b.block_x<=4 &&(int)b.block_x>=-4 &&
((int)plane_mvmt+47)- b.block_y<=3)) Specifies the initial position of the top-left corner of the window in pixels.
}
} void glutInitDisplayMode(unsigned int mode):
Built in Functions:
Request a display with the properties in mode. The value of mode is
void glBegin(glEnum mode): determined by the logical OR of operation including the color model
(GLUT_RGB, GLUT_INDEX) and buffering (GLUT_SINGLE,
Initiates a new primitive of type mode and starts the collection of vertices. Values GLUT_DOUBLE).
of mode include GL_POINTS, GL_LINES and GL_POLYGON. void glFlush( ):
void glEnd( ):
Forces any buffered any OpenGL commands to execute.
Terminates a list of vertices.
void glutInit (intargc, char **argv):
void glColor3f[ i f d ] (TYPE r, TYPE g, TYPE b):
Initializes GLUT. The arguments from main are passed in and can be used
Sets the present RGB colors. Valid types are int( i ), float ( f ) and double ( d ). by the application.
The maximum and minimum values of the floating-point types are 1.0 and 0.0,
respectively.
void glutMainLoop( ): void glViewport(intx,inty,GLsizeiwidth,GLsizei height):

Cause the program to enter an event processing loop. It should be the last statement Specifies a width*height viewport in pixel whose lower left corner is at
in main. (x,y) measured from the origin of the window.
void glutBitmapCharacter(void *font, int char):
void glutDisplayFunc(void (*func) (void)):
Renders the character with ASCII code char at the current raster
Registers the display function func that is executed when the window needs to be position using the raster font given by font. Fonts include
redrawn. GLUT_BITMAP_TIMES_ROMAN_10 and
GLUT_BITMAP_TIMES_ROMAN_24 etc. The raster position is
void glutBitmapCharacter(void *font, int char): incremented by the width of the character.

Renders the character with ASCII code char at the current raster position using the
raster font given by font. Fonts include GLUT_BITMAP_TIMES_ROMAN_10
and GLUT_BITMAP_TIMES_ROMAN_24 etc. The raster position is incremented
by the width of the character.
void glClear(GL_COLOR_BUFFER_BIT):

To make the screen solid and white.

void glutpostRedisplay():

Registers the display function that is executed when the window needs to be
redrawn.

void LoadIdentity():

Sets the current transformation matrix to an identity matrix.

void glEnable(glenum features):

Enables the opengl features.

void glMatrixMode(glenum mode):

Specifies which matrix will be affected by subsequent transformations.


CHAPTER 5 RESULTS AND SNAP SHOTS

Fig 5.3 Building as an obstacle


Fig 5.1 Screen with Menu

The start screen has four options:

1. Play – starts the game.

2. Instructions – Displays the instructions to play the game.

3. About – Details of the student.

4. Exit – Exits from the screen. Fig 5.4 Game over Screen

When the plane collides with the cloud/building, the game ends and the
game over screen appears. This screen shows the distance travelled by
the plane (in meters) and the levels completed.
By clicking on the Restart button, it goes back to the start screen and
you can choose among the four options.

Fig 5.2 Cloud as an obstacle


The plane has to6 escape the cloud/building using mouse interaction. By
pressing the left mouse button, the plane moves upwards and escapes from
the cloud/building. If the plane collides with the cloud/building, the game
ends.
CHAPTER 6 FUTURE ENHANCEMENT CHAPTER 7 CONCLUSION
The enhancements I would like to make for my project are as follows: The project ‘Airplane game’ implemented on Windows platform using C
was completed successfully. It involves various translating, scaling and
 Adding sound effects – for movement of the plane, collision of the plane rotating effects effectively bringing out a simple animation. The utilities and
with cloud/building, level up, background music, plane crashing the functions provided by the OpenGL have been used in an optimal way to
boundaries etc. achieve a completely working project.
 Additional obstacles – like birds, hot air balloons, kites etc. The work done during the process of completion of this project has helped
 Adding collectables – like coins and boosters to buy new parts for the plane me understand the various functionalities available in a better and a more
and other boosts. practical environment and I realize that the scope of OpenGL platform has a
 Adding missions and challenges – daily and weekly challenges, completing premier game developing launch pad. Hence it has indeed been useful in
missions for upgrades and power-ups. developing many games. OpenGL in its own right is good for low cost and
 Customizing the plane – with the coins and boosts collected; customize the simple game development. It serves as an important stepping stone for
plane with new parts for greater speed and control. venturing into other fields of Computer Graphics design and applications.
 Adding various backgrounds for differ levels – new backgrounds for each 3D animation, modeling, gaming etc. are the next big things, and working
new level unlocked. on this project has helped me learn the basics required for it. I have
 Adding more lives for the plane – each player can have a maximum of 3 implemented this project for entertainment purpose and this game is very
lives before the game ends. easy to play.
 Option to disable sound effects – an option to disable sound effects during
or before/after the game.
CHAPTER 8 BIBLIOGRAPHY AND REFERENCES

1. Kamal Acharya. Teacher record management system project


report. Authorea. August 02, 2024.
DOI: https://doi.org/10.22541/au.172261514.46787329/v1
2. Kamal Acharya. POST OFFICE MANAGEMENT SYSTEM PROJECT
REPORT. Authorea. August 02, 2024.
DOI: https://doi.org/10.22541/au.172261514.44494375/v1
3. Kamal Acharya. Fruit shop management system project
report. Authorea. August 02, 2024.
DOI: https://doi.org/10.22541/au.172261514.42227675/v1
4. Kamal Acharya. Dairy management system project
report. Authorea. August 02, 2024.
DOI: https://doi.org/10.22541/au.172261513.39402347/v1
5. Kamal Acharya. DATA COMMUNICATION AND COMPUTER
NETWORK MANAGEMENT SYSTEM PROJECT
REPORT. Authorea. August 01, 2024.
DOI: https://doi.org/10.22541/au.172254873.37480177/v1
6. Kamal Acharya. School management system project
report. Authorea. August 01, 2024.
DOI: https://doi.org/10.22541/au.172254873.34023165/v1
7. Kamal Acharya. A CASE STUDY OF CINEMA MANAGEMENT SYSTEM
PROJECT. Authorea. August 01, 2024.
DOI: https://doi.org/10.22541/au.172254873.30191075/v1
8. Kamal Acharya. Ludo management system project report. Authorea. July
31, 2024
DOI: https://doi.org/10.22541/au.172243999.98091616/v1
9. Kamal Acharya. Literature online quiz system project
report. Authorea. July 31, 2024
DOI: https://doi.org/10.22541/au.172243825.53562953/v1
10. Kamal Acharya. Avoid waste management system project. Authorea. July
29, 2024
DOI: https://doi.org/10.22541/au.172228528.85022205/v1

View publication stats

You might also like