From c4ac81cffcf925963acb0c02584ab22626427a73 Mon Sep 17 00:00:00 2001 From: quou Date: Thu, 4 May 2023 10:15:19 +1000 Subject: Add an animation system. --- animation.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 animation.c (limited to 'animation.c') diff --git a/animation.c b/animation.c new file mode 100644 index 0000000..6dbb08f --- /dev/null +++ b/animation.c @@ -0,0 +1,50 @@ +#include "animation.h" + +static const Animation animations[] = { + /* animation_player_walk_left */ + { + { + { 0, 16, 16, 16 }, + { 16, 16, 16, 16 }, + { 16, 16, 16, 16 }, + { 0, 16, 16, 16 }, + { 32, 16, 16, 16 }, + { 32, 16, 16, 16 } + }, + 6, + 3 + }, + /* animation_player_walk_right */ + { + { + { 0, 0, 16, 16 }, + { 16, 0, 16, 16 }, + { 16, 0, 16, 16 }, + { 0, 0, 16, 16 }, + { 32, 0, 16, 16 }, + { 32, 0, 16, 16 } + }, + 6, + 3 + }, + /* animation_player_idle_left */ + { + { + { 0, 16, 16, 16 }, + }, + 1, + 1 + }, + /* animation__player_idle_right */ + { + { + { 0, 0, 16, 16 }, + }, + 1, + 1 + }, +}; + +const Animation* get_animation(Animation_ID id) { + return &animations[id]; +} -- cgit v1.2.3-54-g00ecf