Last change
on this file was
10771,
checked in by nicolasc, 18 years ago
|
huge diff
cleaned the individual weapons, moved stuff to weapon.{cc,h}
and some minor fixes which popped up then and when
|
File size:
1.8 KB
|
Rev | Line | |
---|
[4827] | 1 | /*! |
---|
[4949] | 2 | @file weapon.h |
---|
[4836] | 3 | * a weapon that a player can use |
---|
[3618] | 4 | |
---|
| 5 | A Player has a list of weapons, that can be choosen to shoot projectiles |
---|
[4949] | 6 | (projectiles.{cc,h}) at enemies. These weapons can be shooted sequentially |
---|
[3618] | 7 | or (if able) combined. Therefore you can choose the weapon mode = choose |
---|
| 8 | a weapon. |
---|
| 9 | |
---|
| 10 | A weapon is characterized by: |
---|
| 11 | o firing-rate: the initial firing rate of a weapon (1/s = Herz) |
---|
| 12 | o slowdown-factor: this is a factor d: exp(-d*x), d is element of all positive R. it determines how fast the firing-rate will slow down. if no slowdown: d=0, the bigger d is, the faster the weapon will slow down! |
---|
| 13 | o energy-consumption: this determines the energy that has to be used to produce this projectile = costs per projectile |
---|
[4827] | 14 | |
---|
[3618] | 15 | Furthermore there are some other attributes, that will help to represent a firing |
---|
| 16 | weapon in this world: |
---|
| 17 | o sound file/ressource: this is a pointer to the sound-file/ressource. however it may be represented |
---|
| 18 | o shooting animation |
---|
[4827] | 19 | |
---|
[3618] | 20 | */ |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | #ifndef _TEST_GUN_H |
---|
| 24 | #define _TEST_GUN_H |
---|
| 25 | |
---|
| 26 | #include "weapon.h" |
---|
| 27 | |
---|
[4959] | 28 | |
---|
| 29 | //! a weapon can be left or right sided |
---|
| 30 | /** |
---|
| 31 | * @todo this will be reset with mirror X/Y/Z |
---|
| 32 | */ |
---|
[10771] | 33 | // #define W_LEFT 0 |
---|
| 34 | // #define W_RIGHT 1 |
---|
[4959] | 35 | |
---|
| 36 | |
---|
[3618] | 37 | class TestGun : public Weapon |
---|
[4934] | 38 | { |
---|
[9869] | 39 | ObjectListDeclaration(TestGun); |
---|
[4827] | 40 | public: |
---|
[5750] | 41 | TestGun (int leftRight); |
---|
[4972] | 42 | TestGun (const TiXmlElement* root); |
---|
[4827] | 43 | virtual ~TestGun (); |
---|
[3618] | 44 | |
---|
[4972] | 45 | void init(); |
---|
[6512] | 46 | virtual void loadParams(const TiXmlElement* root); |
---|
[4972] | 47 | |
---|
[4827] | 48 | virtual void activate(); |
---|
| 49 | virtual void deactivate(); |
---|
[3618] | 50 | |
---|
[4827] | 51 | virtual void fire(); |
---|
[3618] | 52 | |
---|
[5500] | 53 | virtual void draw() const; |
---|
[3752] | 54 | |
---|
[4827] | 55 | private: |
---|
| 56 | PNode* objectComponent1; //<! the gun is made of multiple parts, these PNodes represent their location and orientation |
---|
[3888] | 57 | |
---|
[4827] | 58 | int leftRight; // this will become an enum |
---|
[4934] | 59 | }; |
---|
[3618] | 60 | #endif /* _TEST_GUN_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.