Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/world_entities/player.h @ 5640

Last change on this file since 5640 was 5500, checked in by bensch, 19 years ago

orxonox/trunk: all the WorldEntities now have a const function to draw themselves

File size: 2.1 KB
Line 
1/*!
2 * @file player.h
3 * Implements a basic controllable WorldEntity
4 */
5
6#ifndef _PLAYER_H
7#define _PLAYER_H
8
9#include "world_entity.h"
10#include "physics_interface.h"
11#include "event_listener.h"
12
13template<class T> class tList;
14class Weapon;
15class WeaponManager;
16class Vector;
17class Event;
18
19//! Basic controllable WorldEntity
20/**
21  *  this is the debug player - actualy we would have to make a new
22     class derivated from Player for each player. for now, we just use
23     the player.cc for debug also
24*/
25class Player : public WorldEntity, public EventListener
26{
27  friend class World;
28
29  public:
30    Player();
31    Player(const char* fileName);
32    Player(const TiXmlElement* root);
33    virtual ~Player();
34
35    void init();
36    void loadParams(const TiXmlElement* root);
37
38    void addWeapon(Weapon* weapon);
39    void removeWeapon(Weapon* weapon);
40
41    virtual void postSpawn();
42    virtual void leftWorld();
43
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);
49
50
51  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.
72};
73
74#endif /* _PLAYER_H */
Note: See TracBrowser for help on using the repository browser.