#ifndef _AS_GA_BULLET #define _AS_GA_BULLET /* #ifndef _AS_PC_MATRIX #include "pc_matrix.HPP" #endif */ #ifndef _AS_GA_ARENA #include "ga_arena.hpp" #endif const int AS_BULLET_MOVE_FACTOR = 500; const unsigned int AS_BULLET_ROTATE_FACTOR = 80; const int AS_MAX_BULLETS = 10;//50; const int AS_BULLET_NOSE = 50; class AsBullet; class AsArenaBuilder; class AsPlayer; class AsBulletManager { AsBullet *bullets[AS_MAX_BULLETS]; AsArenaBuilder *map; AsPlayer *player; public: AsBulletManager(); ~AsBulletManager(); void Reset(); void SetFeatures(AsArenaBuilder *_map,AsPlayer *_player); AsBullet *GetCurrentBullet(); AsBullet *GetBullet(int i); void Update(); AsBullet *FindInactiveBullet(); }; class AsBullet { int directionX; int directionZ; int currentDirection; int reverseDirection; int active; int fromPlayer; // charts history of bullet public: // position int X; int Y; int Z; int oldX; int oldY; int oldZ; int xRoom; int yRoom; int zRoom; // rotation in units of AS_DEGREES_360 unsigned int aroundX; unsigned int aroundY; unsigned int aroundZ; // Matrix3D worldView[AS_MAX_REPLICATE]; void Move(unsigned int angle); int GetY() {return(Y);} SetY(int _Y) {Y = _Y;} public: AsBullet(); void Reset(); inline int Active() {return(active);} inline int SetActive() {active = 1;} inline int History() {return(fromPlayer);} inline void RecordHistory() {fromPlayer++;} void Fire(int playerX, int playerY, int playerZ,int turnAngle,int lookAngle ,int xBlock,int yBlock,int zBlock); void SetPosition(int newX, int newY, int newZ); void StoreOldPosition(); void Move(unsigned int turnAngle,unsigned int lookAngle); void MoveForward(); void Turn(int angle); void UpdatePosition(); }; #endif