Changeset 5955 in orxonox.OLD for branches/powerups/src/world_entities/player.h
- Timestamp:
- Dec 7, 2005, 1:05:10 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/powerups/src/world_entities/player.h
r5500 r5955 7 7 #define _PLAYER_H 8 8 9 #include "world_entity.h"10 #include "physics_interface.h"11 9 #include "event_listener.h" 12 10 13 template<class T> class tList; 14 class Weapon; 15 class WeaponManager; 16 class Vector; 17 class Event; 11 /* Forward Declaration */ 12 class Playable; 18 13 19 14 //! Basic controllable WorldEntity … … 23 18 the player.cc for debug also 24 19 */ 25 class Player : public WorldEntity, publicEventListener20 class Player : public EventListener 26 21 { 27 friend class World;28 22 29 23 public: 30 24 Player(); 31 Player(const char* fileName);32 Player(const TiXmlElement* root);33 25 virtual ~Player(); 34 26 35 void init();36 void loadParams(const TiXmlElement* root);27 bool setControllable(Playable* controllalble); 28 inline Playable* getControllable() { return this->controllable; }; 37 29 38 void addWeapon(Weapon* weapon); 39 void removeWeapon(Weapon* weapon); 30 bool disconnectControllable(); 40 31 41 virtual void postSpawn();42 virtual void leftWorld();32 // eventListener extension. 33 virtual void process(const Event &event); 43 34 44 virtual void collidesWith(WorldEntity* entity, const Vector& location); 45 virtual void tick(float time); 46 virtual void draw() const; 47 48 virtual void process(const Event &event); 35 private: 36 void init(); 49 37 50 38 51 39 private: 52 void move(float time); 53 void weaponAction(); 54 55 // !! temporary !! 56 void ADDWEAPON(); 57 58 private: 59 bool bUp; //!< up button pressed. 60 bool bDown; //!< down button pressed. 61 bool bLeft; //!< left button pressed. 62 bool bRight; //!< right button pressed. 63 bool bAscend; //!< ascend button pressed. 64 bool bDescend; //!< descend button presses. 65 bool bFire; //!< fire button pressed. 66 67 WeaponManager* weaponMan; //!< the weapon manager: managing a list of weapon to wepaon-slot mapping 68 69 Vector velocity; //!< the velocity of the player. 70 float travelSpeed; //!< the current speed of the player (to make soft movement) 71 float acceleration; //!< the acceleration of the player. 40 Playable* controllable; //!< The one we controll or NULL if none 72 41 }; 73 42
Note: See TracChangeset
for help on using the changeset viewer.