You are on page 1of 4

MINI PROJECT REPORT

Academic Year: 2022-23 Year and Sem: SE III


Subject: Computer Graphics Lab Course Code: CSL303

Topic: PacMAN Game.


Group Member 1 Name: Savinay Pandey
Roll No: 34
Group Member 2 Name: Krithik Patil
Roll No: 40
Group Member 3 Name: Ayush Panigrahi
Roll No: 35

Technology Used:
C and C++ Programming Language in TurboC/C++ software. C++ is an object-
oriented programming (OOP) language that is viewed by many as the best
language for creating large-scale applications. C++ is a superset of the C
language.
The Turbo C++ editor is used to create the source file, compile, link and
execute programs.The graphics. h header file provides access to a simple
graphics library that makes it possible to draw lines, rectangles, ovals, arcs,
polygons, images, and strings on a graphical window. The second step is initialize
the graphics drivers on the computer using initgraph method of graphics.

Basic idea of the project:


Our version of Pac-Man will have several modifications to the original game.
Enemy units will be configured to attack and defend human players. Our game is
based upon a point system. In a one-person game, if the player gobbles up a
designated number of pellets in the game, then the player wins. Our game will host
a maximum of one human players competing head to head. When the game is in
Hard player mode, a win condition is given to the highest scoring human player,
regardless of Programmed effect. Additionally, our game state will contain “Magic
Pellets” which will offer players special powers such as attack capability,
invincibility, wall smashing…etc.
Pacman Game in C is a simple console application or a mini clip game designed
for the purpose of entertainment. It resembles the snake game to some extent in
which the Pacman should be driven in such a way that it moves along the predefined
blue path so that the path is erased or eaten by Pacman.
Functions used:

i.) setviewport() :
setviewport establishes a new viewport for graphics output. The
viewport corners are given in absolute screen coordinates by (left,top)
and (right,bottom). The current position (CP) is moved to (0,0) in the
new window.

ii.) outtexttxy() :
outtextxy() function which displays the text or string at a specified point (x, y)
on the screen. Syntax : void outtextxy(int x, int y, char *string); where, x, y are
coordinates of the point and, third argument contains the address of string to be
displayed.
iii.) gotoxy() :

places the cursor at the desired location on the screen. This means it is
possible to change the cursor location on the screen using the gotoxy() function.
It is basically used to print text wherever the cursor is moved.

iv.) settextstyle():

The header file graphics.h contains settextstyle() function which is used to


change the way in which text appears. Using it we can modify the size of text,
change direction of text and change the font of text.

v.) fflush():

fflush() function causes the system to empty the buffer that is associated with
the specified output stream, if possible. If the stream is open for input, the
fflush() function undoes the effect of any ungetc() function. The stream remains
open after the call. If stream is NULL, the system flushes all open streams.

vi.) randomize():

Randomize uses Number to initialize the Rnd function's random-


number generator, giving it a new seed value. If you omit Number , the
value returned by the system timer is used as the new seed value.

vii.) restorecrtmode() :
restorecrtmode restores the original video mode detected by initgraph.
This function can be used in conjunction with setgraphmode to switch
back and forth between text and graphics modes. textmode should not
be used. For this purpose; use it only when the screen is in text mode, to
change to a different text mode.

viii.) pieslice() :

pieslice() draws and fills a pie slice with center at (x, y) and given radius
r. The slice travels from s_angle to e_angle which are starting and
ending angles for the pie slice. The angles for pie-slice are given in
degrees and are measured counterclockwise.

ix.) putpixel() :

The header file graphics. h contains putpixel() function which plots a


pixel at location (x, y) of specified color. Syntax : void putpixel(int x,
int y, int color); where, (x, y) is the location at which pixel is to be put ,
and color specifies the color of the pixel.
Screenshots of the output (Minimum 3):

Conclusion:

Here we have used OpenGL as our graphics software for implementing


mini-project for Displaying rainbow. GLUT makes it easier to learn
and explore OpenGL programming. By using the above-mentioned
concepts and various functions that are explained rainbow is
implemented with animation using openGL.

Video of the Output:


Copy-paste the google drive link of a 10-15 seconds videos of the
animation

You might also like