Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 4808 was 4780, checked in by bensch, 19 years ago

orxonox/trunk: 1. the crosshair is registered, @patrick: i thought it was a little bit harder… worked myself through the EventSystem, it is quite cool :)

  1. Player now knows a loadParams and init routine

also testing the Crosshair inside of the Player

File size: 2.0 KB
Line 
1/*!
2    \file player.h
3    \brief 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 World;
18class Event;
19
20//! Basic controllable WorldEntity
21class Player : public WorldEntity, public PhysicsInterface, public EventListener
22{
23  friend class World;
24
25 public:
26  Player();
27  Player(const TiXmlElement* root);
28  virtual ~Player();
29
30  void init();
31  void loadParams(const TiXmlElement* root);
32
33  void addWeapon(Weapon* weapon);
34  void removeWeapon(Weapon* weapon);
35
36  virtual void postSpawn();
37  virtual void leftWorld();
38  virtual void hit(WorldEntity* weapon, Vector* loc);
39  virtual void collide(WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags);
40
41  virtual void tick(float time);
42  virtual void draw();
43
44  virtual void command(Command* cmd);
45
46  virtual void process(const Event &event);
47
48 private:
49  bool bUp;              //!< up button pressed.
50  bool bDown;            //!< down button pressed.
51  bool bLeft;            //!< left button pressed.
52  bool bRight;           //!< right button pressed.
53  bool bAscend;          //!< ascend button pressed.
54  bool bDescend;         //!< descend button presses.
55  bool bFire;            //!< fire button pressed.
56  bool bWeaponChange;    //!< weapon change button pressed
57
58  tList<Weapon>* weapons;//!< a list of weapon
59  Weapon* activeWeapon;  //!< the weapon that is currenty activated
60  Weapon* activeWeaponL;  //temporary -- FIX THIS
61  WeaponManager* weaponMan; //!< the weapon manager: managing a list of weapon to wepaon-slot mapping
62
63  World* myWorld;        //!< reference to the world object
64
65  Vector* velocity;       //!< the velocity of the player.
66  float travelSpeed;     //!< the current speed of the player (to make soft movement)
67  float acceleration;    //!< the acceleration of the player.
68
69  void move(float time);
70  void weapon();
71
72};
73
74#endif /* _PLAYER_H */
Note: See TracBrowser for help on using the repository browser.