no jump ticks?

This commit is contained in:
Tobin
2026-04-20 11:01:14 -04:00
parent c5f584fd13
commit 2753355756
+3 -2
View File
@@ -62,6 +62,7 @@ static float player_vx = 0.0;
static float player_vy = 0.0;
static float player_ax = 0.0;
static float player_ay = 9.81;
static int jump_ticks = 0;
void key_down(char k)
{
@@ -71,7 +72,6 @@ void key_down(char k)
{
case 'a': player_ax = -1; break;
case 'd': player_ax = 1; break;
case 0x20: player_ay -= 1; break;
}
}
@@ -83,7 +83,6 @@ void key_up(char k)
{
case 'a': player_ax = 0; break;
case 'd': player_ax = 0; break;
case 0x20: player_ay += 1; break;
}
}
@@ -176,6 +175,8 @@ void tick(void)
/* code to run every tick goes here */
erase_entities();
if (is_held(' ')) player_ay = -5;
else player_ay = 9.81;
player_vx += player_ax;
player_vy += player_ay;
player_x += (int)player_vx;