Fixed a glitch and modified elevator speed
The on ground state is now only refreshed when the player isn't raising, holding the jump button doesn't cancel the on_ground buffer anymore. Elevator substract twice GRAV now.
This commit is contained in:
parent
51044af762
commit
85564f45d0
BIN
platform.g3a
BIN
platform.g3a
Binary file not shown.
|
@ -69,12 +69,11 @@ int main(void)
|
|||
player_x += hspd;
|
||||
}
|
||||
//ground detection
|
||||
if (collide_solid(player_x, player_y + 1, level)) on_ground = 6;
|
||||
if (vspd >= 0 && collide_solid(player_x, player_y + 1, level)) on_ground = 6;
|
||||
else
|
||||
{
|
||||
if (vspd > MIN_VSPD) vspd += GRAV;
|
||||
if (jump_hold)
|
||||
if (on_ground) on_ground--;
|
||||
if (on_ground) on_ground--;
|
||||
}
|
||||
//vertical movement
|
||||
if (UG_CAN_JUMP) jump_test(&jump_pressed, &jump_buffer, &jump_hold);
|
||||
|
|
Loading…
Reference in New Issue