Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/test/src/world_entities/power_ups/power_up.h

Last change on this file was 9869, checked in by bensch, 18 years ago

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

File size: 1.2 KB
Line 
1/*!
2 * @file power_up.h
3 * @brief A class representing a PowerUp in the world.
4*/
5
6#ifndef _POWER_UP_H
7#define _POWER_UP_H
8
9#include "world_entity.h"
10
11#include "sound_buffer.h"
12#include "sound_source.h"
13
14class Material;
15
16typedef enum PowerUpRespawn {
17  RESPAWN_NONE,
18  RESPAWN_TIME,
19  RESPAWN_size
20} PowerUpRespawn;
21
22class PowerUp : public WorldEntity {
23  ObjectListDeclaration(PowerUp);
24
25public:
26  virtual void loadParams(const TiXmlElement* root);
27  void collidesWith (WorldEntity* entity, const Vector& location);
28
29  void loadPickupSound(const std::string& pickupSound);
30  void loadRespawnSound(const std::string& respawnSound);
31
32  virtual void draw () const;
33  virtual void tick(float dt);
34  void setRespawnType(const std::string& type);
35  void setRespawnTime(const float respawn);
36
37protected:
38  PowerUp(float r, float g, float b);
39  virtual ~PowerUp ();
40
41protected:
42  Model* model;
43
44private:
45  OrxSound::SoundSource  soundSource;
46  OrxSound::SoundBuffer  pickupBuffer;
47  OrxSound::SoundBuffer  respawnBuffer;
48  Material*              sphereMaterial;
49  PowerUpRespawn         respawnType;
50  float                  respawnTime;
51  float                  respawnStart;
52  static const char*     respawnTypes[];
53
54  WorldEntity*           collider;
55};
56
57#endif /* _POWER_UP_H */
Note: See TracBrowser for help on using the repository browser.