/*! * @file fps_player.h * Implements a playable for fps games */ #ifndef _FPS_PLAYER_H #define _FPS_PLAYER_H #include "playable.h" class FPSSniperRifle; class FPSPlayer : public Playable { ObjectListDeclaration(FPSPlayer); public: FPSPlayer(const TiXmlElement* root = NULL); virtual ~FPSPlayer(); virtual void loadParams(const TiXmlElement* root); virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f); virtual void enter(); virtual void leave(); virtual void reset(); virtual void destroy(WorldEntity* killer); virtual void respawn(); virtual void tick(float time); virtual void draw() const; void displayHUDText( const std::string& message ); virtual void process(const Event &event); private: void init(); bool bLeft; //!< strafe left bool bRight; //!< strafe right bool bForward; //!< walk forward bool bBackward; //!< walk backward bool bJump; //!< jumping bool bPosBut; //!< position button bool bFire; //!< fire button bool bFire2; //!< alternate fire button bool bCrouch; //!< crouch button float xMouse; //!< mouse moved in x-Direction float yMouse; //!< mouse moved in y-Direction float heading; //!< the direction where the player heads to float attitude; //!< defines the camera angle to the x-z-plane PNode cameraNode; //!< the "eyes" of the player (or call it head if you want) float fallVelocity; //!< velocity for falling down float jumpAcceleration; //!< the jump acceleration bool initWeapon; bool changeZoom; //!< zoom sight of player bool inZoomMode; //!< zoomsight bool changingZoom; float damageTicker; //!< ticker for dealing damage FPSSniperRifle* weapon; }; #endif