Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

main_char.h

Go to the documentation of this file.
00001 //main_char.h
00002 
00003 #ifndef __MAIN_CHAR_H
00004 #define __MAIN_CHAR_H
00005 
00006 //#define MAIN_CHAR_IMG_FILE "data/images/main_char"
00007 #define MAIN_CHAR_IMG_FILE DATAFILE("images" DIR_SEP "main_char")
00008 #define FRM_NOT_SHOOTING 0
00009 #define FRM_SHOOT_RIGHT01 40
00010 #define FRM_SHOOT_LEFT01 80
00011 #define FRAME_WALK_COUNT 4
00012 
00013 #include "object.h"
00014 
00015 class MainChar : public GameObject {
00016 public:
00017         MainChar(ObjectManager &);
00018         ~MainChar();
00019 
00020         enum direction  { EAST = 0, SOUTHEAST, SOUTH,
00021                            SOUTHWEST, WEST, NORTHWEST, NORTH, NORTHEAST, NO_DIRECTION };
00022         void ChangeDirection( direction ); 
00023 
00024         void setLook(int x, int y);
00025         void setWalking(bool e, bool s, bool w, bool n, bool = false);
00026         void SetWalkingBounds(double l, double r, double w, double h) { min_x = l; min_y = r; max_x = w; max_y = h; }
00027         void think();
00028         int Recenter(); // override this so we either stay at the center
00029                                         // of the screen
00030         
00031         bool isWalking();
00032         int FireWeapon();
00033         void SetWeaponStrength(double);
00034         double GetWeaponStrength() const { return weapon_strength; }
00035 private:
00036 
00037         direction walkDirection;
00038         direction charDirection;
00039         Velocity walk_velocity;
00040         nnctime lastwalk;
00041         nnctime lastshoot;              // time since the last shot
00042 
00043         double min_x, min_y, max_x, max_y;
00044         double msshoot_delay;   // delay in ms before hands go down
00045 
00046         bool walking;
00047         int shooting;   // flags
00048         double weapon_strength; // strength for the gun
00049 };
00050 
00051 
00052 #endif

Generated on Sun Dec 8 12:02:19 2002 for nnc by doxygen1.3-rc1