Documents
Resources
Learning Center
Upload
Plans & pricing Sign in
Sign Out

tutorial

VIEWS: 3 PAGES: 12

									The Introduction to the Computer
          Game Project
        SEG 3100, 2004

            Qing Chen



             04 10 2004
1. Project Structure
 Based on the “POP” game framework

                 Your Game Project

               POP Game Framework

              MS Visual Studio (V6/NET)



 The POP frame can be downloaded from:
 http://www.rudyrucker.com/computergames/zip/
 pop36_3.zip
2. The POP Framework
Object-oriented structure
Files for different purposes:

- MFC files: Control window appearance
 ( childfrm, mainfrm, pop, PopDoc, popview, stdafx )
- Game files: Describe different games
 ( game, gameairhockey, gameballworld, gamepicknpop, GameSpacewar... )
- Critter files: Specify moving objects
 ( biota, critter, critterarmed, critterwall, critterviewer )
- Sprite files: Describe objects appearance
 ( sprite, spritebubble, spriteicon, spritepolygon, spritemultilcon )
- Physics files: define the physics of the world
 ( VectorTransformation, realbox, force )
- Other files: utility files, graphical animation…
 ( controller, listener, graphics, graphicsMFC… )
2. The POP Framework
 Class diagram for POP framework classes
  CPopApp          cTimer     cGame holds an array of critters
                              of the game.
                              - Initializes the critters
                              - Updates critter simulation
                              - keeps track of the critters’ status
                              - displays information of the game
  CPopDoc         CPopView



                                              cSprite

  cGame       *    cCritter                  cListener
                                       *      cForce
2. The POP Framework
 To make a new game:
 - extend the basic “cGame” class.
 - use the available games included in
   framework and make your own changes.
 - change the default start up game by
   editing the CPopDoc constructor in the
   “popdoc.cpp” file:
  # inlcude “gamemyproject.h”
  …
  ProjectCPopDoc::CPopDoc():
  …
  setGameClass(RUNTIME_CLASS(cGameMyProject));
  …
3. Example - cGameStub
 A basic game already available in the
 framework
 A good start point for the project
 You can develop a new game by changing
 the “gamestub.cpp” file without any
 worries about the whole POP framework.
3. Example - cGameStub
 Classes used in the cGameStub code:
        Class name            Parent class
   cGameStub                  cGame

   cCritterStubPlayer         cCritter
   cCritterStubRival
   cCritterStubProp
   cCritterStubPlayerBullet   cCritterBullet
   cCritterStubRivalBullet
3. Example – cGameStub
 Class diagram

             1                     *
                 cGameStubPlayer       cGameStubPlayerBullet



             *
 cGameStub       cGameStubProp


             *                     *
                 cGameStubRival        cGameStubRivalBullet
3. Example – cGameStub
 Writing a space invaders game based on
 cGameStub:
 Refer to the attachment “exercise.pdf”
 from the link:
 http://www.discover.uottawa.ca/~qchen/ga
 me/exercise.pdf
Example Game 1
Example Game 2
Example Game 3

								
To top