opengl game l.
Skip this Video
Loading SlideShow in 5 Seconds..
OpenGL Game PowerPoint Presentation
Download Presentation
OpenGL Game

Loading in 2 Seconds...

play fullscreen
1 / 20

OpenGL Game - PowerPoint PPT Presentation

  • Uploaded on

OpenGL Game by Neal Patel Motivation Learn the basics of game programming Experience for future development in a growing industry Fun Introduction Computer Games once used to be considered children toys. Now they have grown into a multi-billion dollar market.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

OpenGL Game

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
opengl game

OpenGL Game


Neal Patel

  • Learn the basics of game programming
  • Experience for future development in a growing industry
  • Fun
  • Computer Games once used to be considered children toys.
  • Now they have grown into a multi-billion dollar market.
  • Games have come to be known as one of the more creative forms of software development.
  • Game developers are drawn into this industry by the idea of creating their own virtual world that people will one day experience.
elements of a game
Elements of A Game
  • Graphics
  • Input
  • Music and Sound
  • Game Logic and Artificial Intelligence
  • Networking
  • User Interface and Menuing System
enough small talk
Enough Small Talk
  • API used for system
    • OpenGL
      • Open Graphics Library – interface to graphics hardware.
    • SDL
      • Simple DirectMedia Layer – cross platform multimedia library designed to provide fast access to the graphics framebuffer and audio device.
    • Milkshape 3D – 3D animation modeler
concepts learned from programming
Concepts Learned from Programming
  • Texture mapping
    • Loads BMP file via SDL LoadBMP routine

SDL_Surface *image=SDL_LoadBMP(“bitmap.bmp”);

If(image!=NULL) {

SDL_BlitSurface(image, NULL, screen, NULL);



This should create memory space for an image, load it from a file, and display it onto the screen

Blit - To copy a large array of bits from one part of a computer's memory to another part.

special effects presented
Special Effects Presented
  • Particle Systems
    • Through clever use of textures and other properties particle systems can be used to create effects like fire, smoke explosions, liquid (water or blood) spraying, snow, star fields, etc..
    • Attributes the particle system possess.
      • Position
      • Velocity
      • Life Span
      • Color
particle effect cont
Particle Effect (cont.)

effect = ParticleEffect(

EXPLOSION, //Type of particle effect

NONE, //Type of collision detection

Vector(0.0f, 0.0f, 0.6f), //Gravity vector 50, //How random to spray things out

0, //How long the effect will last

0, //How long in frames before each particle begins to fade Vector( 5.5f, 5.5f, 0.5f ), //The origin of the effect

Color( r, g, b ), //The color of the effect

"Data/Texture/Particle.bmp“ //What texture to load


other special effects
Other special effects
  • Billboarding
    • Allows a polygon to always face the viewer. As the player moves at an angle, they will be able to see the object at an angle.
  • Collision Detection
    • Bounding square technique – surrounds a object in the world along their extreme points.
    • A collision is registered whenever the distance between the player and the enemy is less than the sum of the enemy radius and the player radius.
  • Enemies die when they collide with the player, dealing damage to the player equal to (250/e), where e is the initial number of enemies on the map.
  • The initial health of the player is 100 and initial number of enemies is set to 50. Therefore each collision with the enemy will cause the player to lose 5 health. Health of the enemy is set to 0.
sdl implementation for control keys
SDL implementation for control keys

if(keys[SDLK_UP] || keys[SDLK_w]) {

dx += (float)(PLAYER_SPEED*cos(a*PI180));

dy += (float)(PLAYER_SPEED*sin(a*PI180));


if(keys[SDLK_DOWN] || keys[SDLK_s]) {

dx -= (float)(PLAYER_SPEED*cos(a*PI180));

dy -= (float)(PLAYER_SPEED*sin(a*PI180));


if(keys[SDLK_d]) {

dx += (float)(PLAYER_SPEED*0.5f*sin(a*PI180));

dy -= (float)(PLAYER_SPEED*0.5f*cos(a*PI180));


if(keys[SDLK_a]) {

dx -= (float)(PLAYER_SPEED*0.5f*sin(a*PI180));

dy += (float)(PLAYER_SPEED*0.5f*cos(a*PI180));


how the world was generated
How the world was generated
  • First, the map is filled with empty tiles, and the border tiles are made solid. A random point is then selected, and either a horizontal or vertical line of walls is drawn across the room, leaving a open space to navigate to different rooms. This process is called recursively until rooms are of an acceptable size.
drawing and loading texture to a wall
Drawing and loading texture to a wall


glBindTexture(GL_TEXTURE_2D, walltex);






glVertex3i(i+1, j, 0);


glVertex3i(i+1, j+1, 0);


glVertex3i(i+1, j+1, 1.5f);


glVertex3i(i+1, j, 1.5f);


future work
Future Work
  • Implement so player can fire a weapon like a real first person shooter is supposed to do.
  • Add item pickups such as multiple weapons and ammo
  • Better enemies with more advanced AI
  • And why not networking
  • Today game software is developed in teams, where each member works on his or her specialty until the work is integrated to create a work single coherent work of art. They take years to develop. Working with my abilities this is the end result. Hope you enjoyed.
  • Hawkins, Kevin and Dave Astle. OpenGL Game Programming. Premier Press, May 2004.
  • Woo, Mason, J. Neider, and T. Davis. OpenGL Programming Guide. Addison-Wesley, fourth edition, November 2003.