Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 3585 was 3585, checked in by patrick, 19 years ago

orxonox/trunk: player now implements weapon change and fire

File size: 1.5 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
11template<class T> class tList;
12class OBJModel;
13class Weapon;
14
15//! Basic controllable WorldEntity
16class Player : public WorldEntity
17{
18  friend class World;
19 
20 public:
21  Player(bool isFree = false);
22  virtual ~Player();
23
24  void addWeapon(Weapon* weapon);
25  void removeWeapon(Weapon* weapon);
26 
27  virtual void postSpawn();
28  virtual void leftWorld();
29  virtual void hit(WorldEntity* weapon, Vector* loc);
30  virtual void collide(WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags);
31
32  virtual void tick(float time); 
33  virtual void draw();
34
35  virtual void command(Command* cmd);
36 
37 private:
38  bool bUp;              //!< up button pressed.
39  bool bDown;            //!< down button pressed.
40  bool bLeft;            //!< left button pressed.
41  bool bRight;           //!< right button pressed.
42  bool bAscend;          //!< ascend button pressed.
43  bool bDescend;         //!< descend button presses.
44  bool bFire;            //!< fire button pressed.
45  bool bWeaponChange;    //!< weapon change button pressed
46
47  tList<Weapon>* weapons;//!< a list of weapon
48  Weapon* activeWeapon;  //!< the weapon that is currenty activated
49
50  Vector velocity;       //!< the velocity of the player.
51  float travelSpeed;     //!< the current speed of the player (to make soft movement)
52  float acceleration;    //!< the acceleration of the player.
53 
54  void move(float time);
55  void fire(void);
56 
57};
58
59#endif /* _PLAYER_H */
Note: See TracBrowser for help on using the repository browser.