#ifndef FOO_DEFINED #define FOO_DEFINED 1 // Contents of file #endif // FOO_DEFINEDI know it'll be hard to remember, but if we can keep this page updated it'll make our lives easier. -- BrianYoung - 04 Nov 2004 globals:
int GRID_RES - how many sections each dimension of the world is split into
float WORLD_SIZE - how big the world is; in consequence, each grid square is WORLD_SIZE/GRID_RES on a side
int PLAYER_MAX_HEALTH - health the player starts with
main() and all its cousins
GridLoc struct for holding x, y pairs of ints, and passing the pairs around easily
static TankWorld?* instance() - singleton accessor
void changeEnemyGrid() - move an enemy from one grid to another
list<Enemy*>[GRID_RES][GRID_RES]; _enemy_grids - hold all enemies, filed by the grids they're in. I use list instead of vector, because in almost every time we use it we'll be cycling through every enemy in a grid, either checking collisions, or moving, or whatever.
static TankWorld?* theOneTankWorld - singleton pointer
static Player* instance() - singleton accessor
Tuple position() - return the player's position in the world
int score(int points) - add to the player's score and return it
Tuple _position - where the player is
Tuple _heading - which way the player is facing
int _health - how many more hits the player can take
int _score - points accumulated
static Player* theOnePlayer - singleton pointer
void draw() - draw to the current buffer; pure virtual function
void move() - update the enemy's position; pure virtual function
bool hit(int points) - do damage; return true if destroyed
bool checkGrid() - ensure the enemy is still stored in the proper grid; move it if not
Tuple _position - enemy's position in the world
int _hitpoints - number of hitpoints remaining; -1 represents invulnerability
int _pointvalue - how much a kill is worth; can be negative for terrain
GridLoc _inGrid - which grid square we're int
|
Topic FilesAndClasses . { |
|
Revision r1.1 - 05 Nov 2004 - 03:26 GMT - BrianYoung Parents: WebHome > ProjectThree |
Copyright © 1999-2003 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems regarding TWiki? Send feedback. |