bzr branch
http://9ix.org/bzr/minild29
1
by Josh C
initial commit |
1 |
#include "Monocle.h" |
2 |
#include "Graphics/SpriteAnimation.h" |
|
3 |
#include "LevelEditor/LevelEditor.h" |
|
4 |
||
5 |
using namespace Monocle; |
|
6 |
||
7 |
namespace Dark |
|
8 |
{ |
|
9 |
class Player : public Entity |
|
10 |
{ |
|
11 |
public: |
|
12 |
Player(); |
|
13 |
void Update(); |
|
14 |
||
15 |
Vector2 velocity; |
|
16
by Josh C
track palyer noisiness, beginnings of "alert" state for creatures |
16 |
float noisiness; |
1
by Josh C
initial commit |
17 |
|
18 |
SpriteAnimation *sprite; |
|
10
by Josh C
"light" in the dark |
19 |
Entity *dark; |
7
by Josh C
footsteps |
20 |
AudioDeck *footsteps; |
1
by Josh C
initial commit |
21 |
|
3
by Josh C
square moving around the screen |
22 |
int const FRICTION; |
23 |
float const MAXSPEED; |
|
24 |
int const ACCELERATION; |
|
1
by Josh C
initial commit |
25 |
}; |
26 |
||
5
by Josh C
added a "creature" moving around w/ the same dynamics as you do |
27 |
class Creature : public Entity |
28 |
{ |
|
29 |
public: |
|
30 |
Creature(); |
|
31 |
void Update(); |
|
32 |
||
33 |
Vector2 velocity; |
|
34 |
Vector2 direction; |
|
35 |
float aiTime; |
|
26
by Josh C
now they chase you (hunt) |
36 |
float noiseTime; |
27
by Josh C
they hear you more + fixed a bug if they're right on top of you |
37 |
float graceTime; |
5
by Josh C
added a "creature" moving around w/ the same dynamics as you do |
38 |
std::string state; |
22
by Josh C
stalker moves slow and sniffs (and doesn't scuttle) |
39 |
float maxspeed; |
5
by Josh C
added a "creature" moving around w/ the same dynamics as you do |
40 |
|
41 |
SpriteAnimation *sprite; |
|
6
by Josh C
skittering blue square |
42 |
AudioDeck *skitter1; |
17
by Josh C
alert noise |
43 |
AudioAsset *alert; |
22
by Josh C
stalker moves slow and sniffs (and doesn't scuttle) |
44 |
AudioDeck *sniff; |
26
by Josh C
now they chase you (hunt) |
45 |
AudioAsset *freakout; |
5
by Josh C
added a "creature" moving around w/ the same dynamics as you do |
46 |
|
47 |
int const FRICTION; |
|
19
by Josh C
beginnings of "stalk" state |
48 |
int const ACCELERATION; |
22
by Josh C
stalker moves slow and sniffs (and doesn't scuttle) |
49 |
float const DEFAULT_MAXSPEED; |
19
by Josh C
beginnings of "stalk" state |
50 |
float const STALKSPEED; |
22
by Josh C
stalker moves slow and sniffs (and doesn't scuttle) |
51 |
//float const HUNTSPEED; |
5
by Josh C
added a "creature" moving around w/ the same dynamics as you do |
52 |
}; |
53 |
||
18
by Josh C
ping! |
54 |
class Ping : public Entity |
55 |
{ |
|
56 |
public: |
|
57 |
Ping(); |
|
58 |
void Update(); |
|
59 |
static Ping *NewPing(Vector2 pos, float d1, float d2, float t2); |
|
60 |
||
61 |
float d1, d2, t, t2; |
|
62 |
||
63 |
Sprite *sprite; |
|
64 |
}; |
|
65 |
||
1
by Josh C
initial commit |
66 |
class DarkScene : public Scene |
67 |
{ |
|
68 |
public: |
|
69 |
DarkScene(); |
|
70 |
void Begin(); |
|
71 |
void Update(); |
|
21
by Josh C
player and creature spawners in level editor |
72 |
void HideSpawners(); |
73 |
void ShowSpawners(); |
|
74 |
void Spawn(); |
|
1
by Josh C
initial commit |
75 |
|
76 |
LevelEditor *levelEditor; |
|
11
by Josh C
disappear darkness mask in editor mode |
77 |
|
78 |
Player *player; |
|
1
by Josh C
initial commit |
79 |
}; |
80 |
||
81 |
class Text: public Entity |
|
82 |
{ |
|
83 |
public: |
|
84 |
Text(const std::string& text, FontAsset* font=NULL); |
|
85 |
||
86 |
void Render(); |
|
87 |
||
88 |
void SetFont(FontAsset* font) { this->font = font; } |
|
89 |
void SetText(const std::string& text) { this->text = text; } |
|
90 |
||
91 |
protected: |
|
92 |
FontAsset* font; |
|
93 |
std::string text; |
|
94 |
}; |
|
95 |
} |
|
96 |