-
Notifications
You must be signed in to change notification settings - Fork 0
/
caret.h
81 lines (61 loc) · 2.04 KB
/
caret.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
#ifndef _CARET_H
#define _CARET_H
enum EffectTypes
{
EFFECT_NONE = 0,
EFFECT_STARSOLID, // "shot hit wall" dissipation effect
EFFECT_STARPOOF, // "shot exceeded ttl" dissipation effect
EFFECT_FISHY, // common enemy shot dissipation effect
EFFECT_BLOODSPLATTER, // "blood" spatter from hitting enemies
EFFECT_BONKPLUS, // two +'s from player hitting head
EFFECT_BOOMFLASH, // big white circle flash from enemies exploding etc
EFFECT_LEVELUP,
EFFECT_LEVELDOWN,
EFFECT_QMARK, // "?" from pressing down with nothing nearby
EFFECT_BONUSFLASH, // small bright "tink" when hearts/missiles disappear
EFFECT_ZZZZ, // rising sleeping zzzzz's
EFFECT_EMPTY, // rising text that says "empty"
EFFECT_SMOKETRAIL, // small smoke puff
EFFECT_SMOKETRAIL_SLOW, // small smoke puff (slower animate)
EFFECT_HEY, // balloon that says "Hey!" (from grasstown)
EFFECT_GUNFISH_BUBBLE, // bubbles spawned during dissipation of Gunfish shots
EFFECT_LAVA_SPLASH, // just red version of gunfish bubble, really
EFFECT_BUBBLE_BURST, // Bubbler dissipation effect. is NOT CENTERED.
EFFECT_SPUR_HIT, // Spur hit wall effect, used in addition to starsolid.
EFFECT_GHOST_SPARKLE // rising sparkles from Ballos's dog
};
namespace Carets
{
bool init(void);
void close(void);
void DrawAll(void);
int CountByEffectType(int type);
int DeleteByEffectType(int type);
void DestroyAll(void);
};
// synonyms
#define CountEffectsOfType Carets::CountByEffectType
#define DeleteEffectsOfType Carets::DeleteByEffectType
struct Caret
{
void (*OnTick)(Caret *c);
int x, y;
int xinertia, yinertia;
int sprite, frame;
int state;
int effecttype;
int timer, timer2;
int animtimer;
bool invisible;
bool deleted;
Caret *next, *prev;
// ---------------------------------------
void Delete();
void Destroy();
void MoveAtDir(int dir, int speed);
void anim(int speed);
void animdie(int speed);
};
Caret *CreateCaret(int x, int y, int sprite, void (*ontick)(Caret *c), \
int xinertia=0, int yinertia=0);
#endif