diff options
author | quou <quou@disroot.org> | 2023-05-04 14:10:41 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2023-05-04 14:10:50 +1000 |
commit | d61dcdcc384249ec7ea60c9cc18aab9df1f80577 (patch) | |
tree | 563e985e6a1f480461177f2c341d70ce5dd1498d /sprite.c | |
parent | c4ac81cffcf925963acb0c02584ab22626427a73 (diff) |
Add shooting.
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; +} |