A TEXT POST

Tips and Tricks for Game Programming — the first lesson

Normal 0 false false false EN-US X-NONE X-NONE

While starting with game programming one is very enthusiastic but most of them lack quality information on how to go about programming a simple game. There is a dearth of game programming tutorials too. Many amateurs browse from webpage to another without getting a clue as to how to get started. Here is a concept which could be of use to you – a perfect game to start off with, named as Pong. This project makes use of Visual C++ and OpenGL. The main game loop has a set structure which includes:

·         Handle input

·         Movements update

·         Collision Check

·         Check game conditions

·         Rendering

The Pong game structures the game keeping  the set structure in mind. Hence the Game_Main function revolves around this. The game states will keep on changing too while running. We need to take care of the changing states which will be referred to as gameState and will be declared at the start of the game.

The states will be as follows:

1.       Playing

2.       GameOver

3.       GetReady

The GetReady state refers to the state when a player will get a chance to get ready and the game is reset after a goal or at the start of a new game. The game objects will be made using object oriented technology as that would encapsulate the objects making it a well organized effort. There are not many objects for this game which would include a paddle, ball, wall, goal and a board. You can create classes as you progress. Use this concept for your first game!

A TEXT POST

Tips and Tricks for Game Programming — the first lesson

While starting with game programming one is very enthusiastic but most of them lack quality information on how to go about programming a simple game. There is a dearth of game programming tutorials too. Many amateurs browse from webpage to another without getting a clue as to how to get started. Here is a concept which could be of use to you – a perfect game to start off with, named as Pong. This project makes use of Visual C++ and OpenGL. The main game loop has a set structure which includes:

  • Handle input
  • Movements update
  • Collision Check
  • Check game conditions
  • Rendering

The Pong game structures the game keeping the set structure in mind. Hence the Game_Main function revolves around this. The game states will keep on changing too while running. We need to take care of the changing states which will be referred to as gameState and will be declared at the start of the game.
The states will be as follows:

  • Playing
  • GameOver
  • GetReady

The GetReady state refers to the state when a player will get a chance to get ready and the game is reset after a goal or at the start of a new game. The game objects will be made using object oriented technology as that would encapsulate the objects making it a well organized effort. There are not many objects for this game which would include a paddle, ball, wall, goal and a board. You can create classes as you progress. Use this concept for your first game!