Compare commits

..

No commits in common. "d214571ef9187cb65de0224c0b3f063203f60dd0" and "4e8c48c6676e1eaabe28aad6bb4336684f7ddd58" have entirely different histories.

4 changed files with 6 additions and 6 deletions

4
.vscode/launch.json vendored
View File

@ -8,10 +8,10 @@
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/2D_Engine",
"program": "${workspaceRoot}/build/2D_Engine",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",

View File

@ -8,7 +8,7 @@
#define PLAYER_DEFAULT_SPEED 80.0f // px / s
#define PLAYER_DEFAULT_IDLE_ANIMATION_SPEED 250.0f // ms / frame
#define PLAYER_DEFAULT_WALK_ANIMATION_SPEED 160.0f // ms / frame
#define PLAYER_DEFAULT_RUN_ANIMATION_SPEED 160.0f // ms / frame
typedef enum player_state_t {
PLAYER_IDLE = 0x00, // 00000000

View File

@ -65,8 +65,8 @@ static inline void player_system_set_animation(player_system_data_t *system_data
if((system_data->state & PLAYER_RUNNING) && !(system_data->last_state & PLAYER_RUNNING))
{
animation_system_data->frame_delay_ms = PLAYER_DEFAULT_WALK_ANIMATION_SPEED;
animation_system_change_animation(animation_system_data, "player_walk_sheet", 4);
animation_system_data->frame_delay_ms = PLAYER_DEFAULT_RUN_ANIMATION_SPEED;
animation_system_change_animation(animation_system_data, "player_run_sheet", 6);
}
else if(!(system_data->state & PLAYER_RUNNING) && (system_data->last_state & PLAYER_RUNNING))
{

View File

@ -44,7 +44,7 @@ void game_handle_event(void)
static inline void update_time(void)
{
static clock_t last_clock_state = 0;
clock_t last_clock_state = clock();
clock_t start_clock = clock();
game.delta_time_ms = (float)(start_clock - last_clock_state) * 1000.0f / CLOCKS_PER_SEC;
last_clock_state = start_clock;