Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/powerups/src/world_entities/space_ships/space_ship.h @ 5965

Last change on this file since 5965 was 5965, checked in by manuel, 18 years ago

many changes:
created generic weapon_power_up that can contain any kind of weapon
space_ship is now extendable and can pickup weapon_power_ups

File size: 1.9 KB
Line 
1/*!
2 * @file space_ship.h
3 * Implements the Control of a Spaceship
4 */
5
6#ifndef _SPACE_SHIP_H
7#define _SPACE_SHIP_H
8
9#include "playable.h"
10#include "extendable.h"
11
12template<class T> class tList;
13class Vector;
14class Event;
15
16class SpaceShip : public Playable, public Extendable
17{
18
19  public:
20
21    SpaceShip();
22    SpaceShip(const char* fileName);
23    SpaceShip(const TiXmlElement* root);
24    virtual ~SpaceShip();
25
26    void init();
27    void loadParams(const TiXmlElement* root);
28
29    void addWeapon(Weapon* weapon );
30    void removeWeapon(Weapon* weapon);
31
32    virtual void postSpawn();
33    virtual void leftWorld();
34
35    virtual void collidesWith(WorldEntity* entity, const Vector& location);
36    virtual void tick(float time);
37    virtual void draw() const;
38
39    virtual void process(const Event &event);
40
41    bool pickup(PowerUp* powerUp);
42
43
44
45  private:
46
47    void calculateVelocity(float time);
48    void weaponAction();
49
50    // !! temporary !!
51    void ADDWEAPON();
52
53    bool                  bUp;                //!< up button pressed.
54    bool                  bDown;              //!< down button pressed.
55    bool                  bLeft;              //!< left button pressed.
56    bool                  bRight;             //!< right button pressed.
57    bool                  bAscend;            //!< ascend button pressed.
58    bool                  bDescend;           //!< descend button presses.
59    bool                  bFire;              //!< fire button pressed.
60
61    Vector                velocity;           //!< the velocity of the player.
62    Vector                velocityDir;        //!< the direction of the velocity of the spaceship
63    float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
64    float                 acceleration;       //!< the acceleration of the player.
65
66};
67
68#endif /* _SPACE_SHIPS_H */
Note: See TracBrowser for help on using the repository browser.