Entirely expanded upon existing proof-of-concept

This commit is contained in:
2026-06-16 11:23:16 -04:00
parent e8d29b7f6b
commit baa5a6935f
19 changed files with 2373 additions and 16 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}
);
}
}