From d61dcdcc384249ec7ea60c9cc18aab9df1f80577 Mon Sep 17 00:00:00 2001 From: quou Date: Thu, 4 May 2023 14:10:41 +1000 Subject: Add shooting. --- sprite.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sprite.c (limited to 'sprite.c') 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; +} -- cgit v1.2.3-54-g00ecf