This commit is contained in:
Masséna Fezard | Nounouille 2022-01-12 16:43:22 +01:00
parent c104870634
commit d433f8bc2d
7 changed files with 10 additions and 3 deletions

View File

@ -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)

Binary file not shown.

BIN
assets-cg/scarletL.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
assets-cg/scarletR.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -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

View File

@ -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);

View File

@ -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();
}