diff --git a/CMakeLists.txt b/CMakeLists.txt index 11c1cef..1ab7fa6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,8 @@ set(SOURCES set(ASSETS_cg assets-cg/tileset.png assets-cg/hooksel.png + assets-cg/scarletR.png + assets-cg/scarletL.png ) fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} WITH_METADATA) diff --git a/assets-cg/scarlet.ase b/assets-cg/scarlet.ase index b4e34c3..be06a04 100644 Binary files a/assets-cg/scarlet.ase and b/assets-cg/scarlet.ase differ diff --git a/assets-cg/scarletL.png b/assets-cg/scarletL.png new file mode 100644 index 0000000..26f97a2 Binary files /dev/null and b/assets-cg/scarletL.png differ diff --git a/assets-cg/scarletR.png b/assets-cg/scarletR.png new file mode 100644 index 0000000..aa41f06 Binary files /dev/null and b/assets-cg/scarletR.png differ diff --git a/include/conf.h b/include/conf.h index a92ea64..da1d112 100644 --- a/include/conf.h +++ b/include/conf.h @@ -1,6 +1,8 @@ #pragma once #define PLAYER_S 12 +#define PLAYER_W 22 +#define PLAYER_H 18 #define PLAYER_ACC 1.5 #define PLAYER_FRIC 0.4 diff --git a/include/player.h b/include/player.h index 22dde4f..81aab3b 100644 --- a/include/player.h +++ b/include/player.h @@ -8,10 +8,10 @@ struct Player { struct Vec2 spawn; struct Vec2 hook_pos; struct Vec2 hook_near; - int jumping, airbreak, hooking, locked; + int jumping, airbreak, hooking, locked, dir; }; void player_init(void); void player_update(void); -void player_draw(void); +void player_draw(int frame); struct Vec2 player_get_pos(void); diff --git a/src/main.c b/src/main.c index 481f507..7e583ca 100644 --- a/src/main.c +++ b/src/main.c @@ -6,6 +6,7 @@ #include "player.h" static int running = 1; +static int timer = 0; static void init(void); static void update(void); static void draw(void); @@ -38,6 +39,8 @@ update(void) { input_step(); player_update(); + + ++timer; } static void @@ -45,7 +48,7 @@ draw(void) { dclear(C_BLACK); level_draw(); - player_draw(); + player_draw(timer); hook_debug_draw(); dupdate(); }