Scale factor and expansion upon basic implementation

This commit is contained in:
2026-06-15 11:54:39 -04:00
committed by P7MJ
parent c4930f77df
commit 4b545205aa
19 changed files with 2400 additions and 41 deletions

39
src/player.c Normal file
View File

@@ -0,0 +1,39 @@
#include "player.h"
#include "world.h"
#include "config.h"
#include "raylib.h"
void UpdatePlayerControls(void)
{
if (!player)
return;
if (IsKeyDown(KEY_A))
{
ApplyForce(
player,
(Vector2){-PLAYER_FORCE, 0}
);
}
if (IsKeyDown(KEY_D))
{
ApplyForce(
player,
(Vector2){PLAYER_FORCE, 0}
);
}
if (IsGrounded(player) &&
IsKeyPressed(KEY_SPACE))
{
player->velocity.y = 0;
ApplyForce(
player,
(Vector2){0, -JUMP_FORCE}
);
}
}