Game Development basic - PowerPoint PPT Presentation

palmer
nguy n trung h i n.
Skip this Video
Loading SlideShow in 5 Seconds..
Game Development basic PowerPoint Presentation
Download Presentation
Game Development basic

play fullscreen
1 / 14
Download Presentation
Presentation Description
203 Views
Download Presentation

Game Development basic

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Nguyễn Trung Hải Game Development basic

  2. Outline • Game Structure • Animation using Sprite • Demo

  3. Reference • [1]: http://en.wikipedia.org/wiki/Game_programming • [2]: Mummy Game Project

  4. Game Structure

  5. Game Structure • Game loop: While (1) { check for user input run AI move enemies resolve collisions draw graphics play sounds }

  6. Game Structure • Game States: • Splash • Main Menu • Loading • In Game • In Game Menu • Win Over

  7. Game Structure • Implement: Run() { switchState(beginningState); while(!exitState) { updateState(State,Mode); repaint(); } }

  8. Game Structure • Implement: • switchState(): is a function that will change Game State from this state to another one. switchState() { Call Old-State’s destructor(); Call New-State’s constructor(); }

  9. Game Structure • Implement: • updateState(): every Game State has its update() function such as: updateSplash(), updateMainMenu(),... • General upadateState() function has 4 modes: • Constructor • Destructor • Paint • Update (update information cause gamer interaction)

  10. Game Structure • Implement: • Repaint(): will call paint() function of every game state. Paint() { updateState(currentState, mode=Paint); }

  11. Game Structure • Frame Per Second (FPS): Const FPS = 25; Const Timer = 1000/FPS; ... while(!exitState) { updateState(State,Mode); repaint(); compute sleeptime; if (sleeptime>0) wait sleeptime; }

  12. Animation using Sprite • Code Implement: • Create new Sprite Object: • Image Path • Sprite Width & Heigh • Transparency process • Set Frame Sequence. • Draw Sprite object.

  13. Demo • Mummy Game

  14. Thank You!!!