aboutsummaryrefslogtreecommitdiff
path: root/dat.h
diff options
context:
space:
mode:
Diffstat (limited to 'dat.h')
-rw-r--r--dat.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/dat.h b/dat.h
index 4dd4250..a3065ee 100644
--- a/dat.h
+++ b/dat.h
@@ -1,6 +1,7 @@
-typedef struct State State;
+typedef struct GameState GameState;
typedef struct Derivative Derivative;
typedef struct Stats Stats;
+typedef struct Sprite Sprite;
struct Stats
{
@@ -12,7 +13,7 @@ struct Stats
void (*update)(Stats*, double);
};
-struct State
+struct GameState
{
double x, v;
Stats stats;
@@ -22,3 +23,17 @@ struct Derivative
{
double dx, dv;
};
+
+struct Sprite
+{
+ Image *sheet;
+ Point sp;
+ Rectangle r;
+ int nframes;
+ int curframe;
+ ulong period;
+ ulong elapsed;
+
+ void (*step)(Sprite*, ulong);
+ void (*draw)(Sprite*, Image*, Point);
+};