diff options
Diffstat (limited to 'dat.h')
-rw-r--r-- | dat.h | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -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); +}; |