aboutsummaryrefslogtreecommitdiff
path: root/dat.h
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2023-05-22 09:00:42 +0000
committerrodri <rgl@antares-labs.eu>2023-05-22 09:00:42 +0000
commite095f65376894dcdef067b63103f2e17e55a1f14 (patch)
treea941d8ed6b6c6149aa1eee503b11a955fdcf7213 /dat.h
parent1baca76aaf266a2d071af4a173aee5b85efeffd6 (diff)
downloadmusw-e095f65376894dcdef067b63103f2e17e55a1f14.tar.gz
musw-e095f65376894dcdef067b63103f2e17e55a1f14.tar.bz2
musw-e095f65376894dcdef067b63103f2e17e55a1f14.zip
improvements to show a bullet's explosion upon ttl consumption.
implemented a vfx subsystem to handle localized, async animations.
Diffstat (limited to 'dat.h')
-rw-r--r--dat.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/dat.h b/dat.h
index 4c9e019..024c1c9 100644
--- a/dat.h
+++ b/dat.h
@@ -59,6 +59,7 @@ enum {
typedef struct VModel VModel;
typedef struct Sprite Sprite;
+typedef struct Vfx Vfx;
typedef struct Keymap Keymap;
typedef struct State State;
typedef struct Particle Particle;
@@ -101,6 +102,18 @@ struct Sprite
void (*step)(Sprite*, ulong);
void (*draw)(Sprite*, Image*, Point);
+ Sprite *(*clone)(Sprite*);
+};
+
+struct Vfx
+{
+ Sprite *a; /* animation */
+ Point p;
+ int times; /* to repeat. -1 loops forever */
+ Vfx *prev, *next;
+
+ void (*step)(Vfx*, ulong);
+ void (*draw)(Vfx*, Image*);
};
struct Keymap
@@ -133,7 +146,6 @@ struct Bullet
struct Ship
{
Particle;
- Kind kind;
int fuel;
Bullet rounds[10];
VModel *mdl;