WIP docs: commenting in player.c/player.h and README updates

This commit is contained in:
2026-06-16 13:23:01 -04:00
parent 944c6c8da4
commit 1e597beeee
4 changed files with 14 additions and 6 deletions

View File

@@ -5,11 +5,15 @@
#include "raylib.h"
// let's a go!
void UpdatePlayerControls(void)
{
// if there isn't a player, you probably can't do much
if (!player)
return;
// if a key pressed, push player to the left
if (IsKeyDown(KEY_A))
{
ApplyForce(
@@ -17,7 +21,7 @@ void UpdatePlayerControls(void)
(Vector2){-PLAYER_FORCE, 0}
);
}
// if d key pressed, push player to the right
if (IsKeyDown(KEY_D))
{
ApplyForce(
@@ -25,7 +29,7 @@ void UpdatePlayerControls(void)
(Vector2){PLAYER_FORCE, 0}
);
}
// if sspace key pressed (and player isn't already jumping), push player upward
if (IsGrounded(player) &&
IsKeyPressed(KEY_SPACE))
{