CG Mini Project Format
CG Mini Project Format
2D GAMING
A
Mini Project
Report on
SUBMITTED BY
SARVESH SHAHANE ROLL NO -49
ADITYA MODAK ROLL NO –
33 PRANAV NIMJE ROLL NO -
35
AFFILIATED TO
pg. 1
DEPARTMENT OF COMPUTER ENGINEERING
Downloaded by Saylee Bandal ([email protected])
lOMoARcPSD|39464413
2D GAMING
CERTIFICATE
This is to certify that the seminar report entities
“ 2D GAMING ”
Submitted by
SARVESH SHAHANE ROLL NO – 49
ADITYA MODAK ROLL NO – 33
PRANAV NIMJE ROLL NO – 35
Dr.R S.Pawar
Principal
PADMABHOOSHAN VASANTDADA PATIL INSTITUTE OF
TECHNOLOGY,BAVADHAN, PUNE-21.
pg. 2
DEPARTMENT OF COMPUTER ENGINEERING
Downloaded by Saylee Bandal ([email protected])
lOMoARcPSD|39464413
2D GAMING
ACKNOWLEDGEMENT
With due respect and gratitude Itake the opportunity to thank those who have Helped
medirectly and indirectly. I convey my sincere thanks to Prof.G.S.Wayal HoD of computer
Department. and Prof. Shobha Bamane their help in selecting The mini project topic and
support. I thank to my seminar guide Prof. Prof.Shobha Bamane for her guidance, timely
Help and valuable suggestions without which this seminar would not have been. Possible.
Her direction has always been encouraging as well as inspiring for me. Attempts have been
made to minimize the errors in the report. I would also like to express my appreciation and
thanks to all my friends who Knowingly have assisted and encourage me throughout my hard
Work.
pg. 3
DEPARTMENT OF COMPUTER ENGINEERING
Downloaded by Saylee Bandal ([email protected])
lOMoARcPSD|39464413
2D GAMING
ABSTRACT
The broad objective of this study is an attack, threat and vulnerabilities of cyber
infrastructure, which include hardware and software systems, networks, enterprise networks,
intranets, and its use of the cyber intrusions. To achieve this objective, the paper attempts to
explain the importance g in network intrusions and cyber-theft. It also discusses in vivid
detail, the reasons for the quickdilation of cybercrime. The paper also includes a complete
description and definition of cyber security, the role it plays in network intrusion and cyber
recognize theft, a discussion of the reasons for the rise in cybercrime and their impact. In
closing the authors recommend some preventive measures and possible solutions to the
attack, threats and vulnerabilities of cyber security. The paper concludes that while
technology has a role to play in reducing the impact of cyber attacks, the vulnerability resides
with human behaviour and psychological predispositions. While literature supports the
dangers of psychological susceptibilities in cyber attacks investment in organizational
education campaigns offer optimism that cyber attacks can be reduced
pg. 4
DEPARTMENT OF COMPUTER ENGINEERING
Downloaded by Saylee Bandal ([email protected])
lOMoARcPSD|39464413
2D GAMING
INTRODUCTION
pg. 5
DEPARTMENT OF COMPUTER ENGINEERING
Downloaded by Saylee Bandal ([email protected])
lOMoARcPSD|39464413
2D GAMING
Graphics provides one of the most natural means of communicating within a computer,
since our highly developed 2D and 3D pattern-recognition abilities allow us to perceive
and process pictorial data rapidly and effectively. Interactive computer graphics is the
most important means of producing 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, synthetic objects, such as
mathematical surfaces and of data that have no inherent geometry, such as survey
results.
Computer graphics started with the display of data on hardcopy plotters and cathode
ray tube screens soon after the introduction of computers themselves. It has grown to
include the creation, storage, and manipulation of models and images of objects. These
models come from a diverse and expanding set of fields, and include physical,
mathematical, engineering, architectural, and even conceptual structures, natural
phenomena, and so on. Computer graphics today is largely interactive. The user
controls the contents, structure, and appearance of the objects and of their displayed
images by using input devices, such as keyboard, mouse, or touch-screen.
Due to close relationships between the input devices and the display, the handling of
such devices is included in the study of computer graphics. The advantages of the
interactive graphics are many in number. Graphics provides one of the most natural
means of communicating with a computer, since our highly developed 2D and 3D
patter-recognition abilities allow us to perceive and process data rapidly and
efficiently.
In many design, implementation, and construction processes today, the information
pictures can give is virtually indispensable. Scientific visualization became an important
field in the 1980s when the scientists and engineers realized that they could not interpret
the prodigious quantities of data produced in supercomputer runs without summarizing
the data and highlighting trends and phenomena in various kinds of graphical
representations.
pg. 6
DEPARTMENT OF COMPUTER ENGINEERING
Downloaded by Saylee Bandal ([email protected])
lOMoARcPSD|39464413
2D GAMING
For example, all objects are built from points, lines and convex polygons. Higher level
objects like cubes are implemented as six four-sided polygons.
OpenGL supports features like 3-dimensions, lighting, anti-aliasing, shadows, textures,
depth effects, etc.
It is system-independent. It does not assume anything about hardware or operating
system and is only concerned with efficiently rendering mathematically described
scenes. As a result, it does not provide any windowing capabilities.
It is a state machine. At any moment during the execution of a program there is a
current model transformation
It is a rendering pipeline. The rendering pipeline consists of the following steps:
Defines objects mathematically.
Arranges objects in space relative to a viewpoint.
Calculates the color of the objects.
Rasterizes the objects.
pg. 7
DEPARTMENT OF COMPUTER ENGINEERING
Downloaded by Saylee Bandal ([email protected])
lOMoARcPSD|39464413
2D GAMING
Future prospects:
Further this project can be enhanced by adding few more options i,e menus in game.
Using this we can design a 3D game which contains cube instead of single window and
multiple number of balls which are randomly moving and all faces of cube is considered
as wall.
pg. 8
DEPARTMENT OF COMPUTER ENGINEERING
Downloaded by Saylee Bandal ([email protected])
lOMoARcPSD|39464413
2D GAMING
pg. 9
DEPARTMENT OF COMPUTER ENGINEERING
Downloaded by Saylee Bandal ([email protected])
lOMoARcPSD|39464413
2D GAMING
pg. 10
DEPARTMENT OF COMPUTER ENGINEERING
Downloaded by Saylee Bandal ([email protected])
lOMoARcPSD|39464413
2D GAMING
pg. 11
DEPARTMENT OF COMPUTER ENGINEERING
Downloaded by Saylee Bandal ([email protected])
lOMoARcPSD|39464413
2D GAMING
pg. 12
DEPARTMENT OF COMPUTER ENGINEERING
Downloaded by Saylee Bandal ([email protected])
lOMoARcPSD|39464413
2D GAMING
CODE -
#include <GL/glut.h>
#include <stdio.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include<string.h>
#define bool int
#define true 1
#define false 0
#define FROM_RIGHT 1
#define FROM_LEFT 2
#define FROM_TOP 3 #define FROM_BOTTOM 4
int game=0; int p=0; int a,b,c,d; static mouse_x=0; static int value = 0; static int submenu_id; static
int bmenu_id; static int menu_id; static int nu_id; static int id; static int window;
double r1=1,g1=1,b1=1,r2=1,g2=1,b2=1.0; static int z=0;
static int WINDOW_WIDTH ,WINDOW_HEIGHT; int playerResult=0; int pcResult =0;
static float Xspeed=1,Yspeed=1; //for moving ball static float delta=1; //ball movements in
steps char string [100]; static int sizeb=0;
RECTA ball={10,10,20,20};
RECTA wall ;
RECTA player_1 ={100,490,40,500};
//drawing ball
void DrawBall(RECTA rect,double r,double g,double b)
{
glColor3f(r,g,b); glBegin(GL_QUADS);
glVertex2f(rect.left,rect.bottom); glVertex2f(rect.right,rect.bottom);
glVertex2f(rect.right,rect.top); glVertex2f(rect.left,rect.top); glEnd();
}
//drawing bat
pg. 13
DEPARTMENT OF COMPUTER ENGINEERING
Downloaded by Saylee Bandal ([email protected])
lOMoARcPSD|39464413
2D GAMING
//drawing text
void drawText(char* string,int x, int y)
{ int len, i; glRasterPos2f(x,y); len=(int) strlen(string); for(i = 0; i < len; i++)
{
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24,string[i]); }
}
//test collision between ball and wall int Test_Ball_Wall(RECTA ball , RECTA wall)
{
if(ball.right >=wall.right) return FROM_RIGHT; if(ball.left <=wall.left) return
FROM_LEFT; if(ball.top <=wall.top) return FROM_TOP; if(ball.bottom >=wall.bottom)
return FROM_BOTTOM; else return 0 ;
}
//calculating score
bool Test_Ball_Player(RECTA ball,RECTA player)
{
if(ball.bottom >= player.top && ball.left>= player.left && ball.right <=player.right )
{
playerResult++; return true;
}
return false;
}
pg. 14
DEPARTMENT OF COMPUTER ENGINEERING
Downloaded by Saylee Bandal ([email protected])
lOMoARcPSD|39464413
2D GAMING
pg. 15
DEPARTMENT OF COMPUTER ENGINEERING
Downloaded by Saylee Bandal ([email protected])
lOMoARcPSD|39464413
2D GAMING
Conclusion:
The project was started with modest aim with no prior experience in any
programming projects as this, but ended up in learning many things, fine tuning
the programming skills and getting into the real world of software development
with an exposure to corporate environment. During the development of any
software of significant utility, we are forced with the tradeoff between speed of
execution and amount of memory consumed. This is simple interactive
application. It is extremely user friendly and has the features, which makes
simple graphics project. It has an open source and no security features has been
included. The user is free to alter the code for feature enhancement. Checking and
verification of all possible types of the functions are taken care. Care was taken to
avoid bugs. Bugs may be reported to creator as the need.
pg. 16
DEPARTMENT OF COMPUTER ENGINEERING
Downloaded by Saylee Bandal ([email protected])
lOMoARcPSD|39464413
2D GAMING
References :
1) GOOGLE
2) GEEKS FOR GEEKS FOR CONCEPT
pg. 17
DEPARTMENT OF COMPUTER ENGINEERING
Downloaded by Saylee Bandal ([email protected])
lOMoARcPSD|39464413
2D GAMING
pg. 18
DEPARTMENT OF COMPUTER ENGINEERING
Downloaded by Saylee Bandal ([email protected])