diff options
Diffstat (limited to 'sprite.c')
-rw-r--r-- | sprite.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sprite.c b/sprite.c new file mode 100644 index 0000000..8289fd2 --- /dev/null +++ b/sprite.c @@ -0,0 +1,32 @@ +#include "sprite.h" + +static const Sprite sprites[] = { + /* sprite_player_bullet_left */ + { + asset_id_bullet, + { 9, 0, 9, 14 } + }, + /* sprite_player_bullet_right */ + { + asset_id_bullet, + { 0, 0, 9, 14 } + }, + /* sprite_player_bullet_up */ + { + asset_id_bullet, + { 0, 14, 14, 9 } + }, + /* sprite_player_bullet_down */ + { + asset_id_bullet, + { 14, 14, 14, 9 } + } +}; + +void init_csprite(CSprite* sprite, Sprite_ID id) { + const Sprite* s; + + s = &sprites[id]; + sprite->id = s->bitmap; + sprite->rect = s->rect; +} |