-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathCBonus.h
95 lines (59 loc) · 1.35 KB
/
CBonus.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/////////////////////////////////////////
//
// OpenLieroX
//
// code under LGPL, based on JasonBs work,
// enhanced by Dark Charlie and Albert Zeyer
//
//
/////////////////////////////////////////
// Bonus class
// Created 5/8/02
// Jason Boettcher
#ifndef __CBONUS_H__
#define __CBONUS_H__
struct SDL_Surface;
class CViewport;
class CGameScript;
#include "CVec.h"
#define MAX_BONUSES 32
#define BONUS_SPAWNFREQ 30
#define BONUS_LIFETIME 60
// Bonus types
#define BNS_WEAPON 0
#define BNS_HEALTH 1
#define BNS_FULLCHARGE 2
class CBonus {
public:
// Constructor
CBonus() {
bUsed = false;
}
private:
// Attributes
bool bUsed;
int iType;
int iWeapon;
std::string sWeapon;
CVec vPos;
CVec vVelocity;
float fLife;
AbsTime fSpawnTime;
float fFlashTime;
public:
// Methods
void Spawn(CVec pos, int type, int weapon, CGameScript *gs);
void Draw(SDL_Surface * bmpDest, CViewport *v, bool showname);
// variables
bool getUsed() { return bUsed; }
void setUsed(bool _u);
int getType() { return iType; }
int getWeapon() { return iWeapon; }
AbsTime getSpawnTime() { return fSpawnTime; }
CVec getPosition() { return vPos; }
CVec& pos() { return vPos; }
CVec& velocity() { return vVelocity; }
float& life() { return fLife; }
float& flashTime() { return fFlashTime; }
};
#endif // __CBONUS_H__