NXEngine v1.0.0.2
[NXEngine.git] / caret.h
blobda006ddddec172755e477783f781a88cedca8d5a
2 #ifndef _CARET_H
3 #define _CARET_H
5 enum EffectTypes
7 EFFECT_NONE = 0,
9 EFFECT_STARSOLID, // "shot hit wall" dissipation effect
10 EFFECT_STARPOOF, // "shot exceeded ttl" dissipation effect
11 EFFECT_FISHY, // common enemy shot dissipation effect
12 EFFECT_BLOODSPLATTER, // "blood" spatter from hitting enemies
13 EFFECT_BONKPLUS, // two +'s from player hitting head
14 EFFECT_BOOMFLASH, // big white circle flash from enemies exploding etc
15 EFFECT_LEVELUP,
16 EFFECT_LEVELDOWN,
17 EFFECT_QMARK, // "?" from pressing down with nothing nearby
18 EFFECT_BONUSFLASH, // small bright "tink" when hearts/missiles disappear
19 EFFECT_ZZZZ, // rising sleeping zzzzz's
20 EFFECT_EMPTY, // rising text that says "empty"
21 EFFECT_SMOKETRAIL, // small smoke puff
22 EFFECT_SMOKETRAIL_SLOW, // small smoke puff (slower animate)
23 EFFECT_HEY, // balloon that says "Hey!" (from grasstown)
24 EFFECT_GUNFISH_BUBBLE, // bubbles spawned during dissipation of Gunfish shots
25 EFFECT_LAVA_SPLASH, // just red version of gunfish bubble, really
26 EFFECT_BUBBLE_BURST, // Bubbler dissipation effect. is NOT CENTERED.
27 EFFECT_SPUR_HIT, // Spur hit wall effect, used in addition to starsolid.
28 EFFECT_GHOST_SPARKLE // rising sparkles from Ballos's dog
32 namespace Carets
34 bool init(void);
35 void close(void);
37 void DrawAll(void);
38 int CountByEffectType(int type);
39 int DeleteByEffectType(int type);
40 void DestroyAll(void);
43 // synonyms
44 #define CountEffectsOfType Carets::CountByEffectType
45 #define DeleteEffectsOfType Carets::DeleteByEffectType
47 struct Caret
49 void (*OnTick)(Caret *c);
51 int x, y;
52 int xinertia, yinertia;
53 int sprite, frame;
55 int state;
56 int effecttype;
58 int timer, timer2;
59 int animtimer;
61 bool invisible;
62 bool deleted;
64 Caret *next, *prev;
66 // ---------------------------------------
68 void Delete();
69 void Destroy();
70 void MoveAtDir(int dir, int speed);
72 void anim(int speed);
73 void animdie(int speed);
76 Caret *CreateCaret(int x, int y, int sprite, void (*ontick)(Caret *c), \
77 int xinertia=0, int yinertia=0);
80 #endif