gmanager.h
author Mohammed Khoory
Wed Jul 07 19:11:38 2010 -0400 (22 months ago)
changeset 5 bcf3d6f89c62
parent 0 fbd3d2dbfcdf
permissions -rw-r--r--
Keyboard support, code movement, and TestManager

Major Changes
=============
- Added "testman.h" and "testman.cpp" to be used exclusively to test stuff (from a
GameManager perspective)
- Moved all the testing stuff to testman.cpp. 9game is just an empty class now to
manage other GameManagers
- Moved all the initializing stuff from 9Game to main. 9Game is like any other
GameManager now (just that it manages other GameManagers)
- Added keyboard.h and keyboard.c to handle keyboard interrupts (by replacing the
keyboard ISR)
- Keyboard is working :D can read more than one key at a time. (tested in
TestManager with WASD)

Minor Changes
=============
- Removed the exception throwing in SpriteLoader::unloadFile() (because it just
makes things unnecessarily complicated)
- added finished() to GameManager to indicate whether a GameManager is finished or
not
- Animation test + key control test. Sprite moves around depending on wasd key
input. (program ends when off screen to right)
- Set 0x00 as transparency color with drawSprite (TODO: change to make this
customizeable on runtime)
- Edited Makefile to reflect new changes

Notes
=====
- Animation seems to work nice and smooth in dosbox, slow in dosemu, so maybe I
should start testing in both dosemu and dosbox
- TODO: fix bug with drawSprite. When a sprite is drawn on the right of the screen
it "wraps around" to the other side by one pixel in width
     1 /* --------
     2    this class defines a GameManager
     3    
     4    a GameManager is a Renderable Interactive class that can add and remove and manage
     5    several game objects. For example, a menu can be a game manager, a game level can be a
     6    game manager
     7    
     8   */
     9 #ifndef GAMEMANAGER
    10 #define GAMEMANAGER
    11 
    12 #include "intractv.h"
    13 #include "renderbl.h"
    14 #include "gobject.h"
    15 
    16 class GameManager : public Interactive , public Renderable
    17 {
    18 protected:
    19 	
    20 public:
    21 	virtual int registerGameObject(GameObject * aGameObject) = 0; // adds an object to the game
    22 	virtual int finished() = 0; // returns GameManager::NOT_FINISHED if not done, anything else otherwise
    23 	
    24 	static const int NOT_FINISHED = 0;
    25 };
    26 
    27 #endif
    28