00001
00002
00003 #ifndef __MAIN_CHAR_H
00004 #define __MAIN_CHAR_H
00005
00006
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();
00029
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;
00042
00043 double min_x, min_y, max_x, max_y;
00044 double msshoot_delay;
00045
00046 bool walking;
00047 int shooting;
00048 double weapon_strength;
00049 };
00050
00051
00052 #endif