This commit is contained in:
Josh Deprez 2021-08-20 13:17:17 +10:00
parent 9a3da85999
commit eed4909fb7

View file

@ -122,8 +122,8 @@ func (aw *Awakeman) realUpdate() error {
if inpututil.IsKeyJustPressed(ebiten.KeySpace) || inpututil.IsKeyJustPressed(ebiten.KeyZ) { if inpututil.IsKeyJustPressed(ebiten.KeySpace) || inpututil.IsKeyJustPressed(ebiten.KeyZ) {
// On ground or recently on ground? // On ground or recently on ground?
if aw.coyoteTimer > 0 { if aw.coyoteTimer > 0 {
// Jump. One frame of a = jumpVelocity (ignoring any gravity already applied this tick). // Jump. One frame of v = jumpVelocity (ignoring any gravity already applied this tick).
aw.vy += jumpVelocity aw.vy = jumpVelocity
} else { } else {
// Buffer the jump in case aw hits the ground soon. // Buffer the jump in case aw hits the ground soon.
aw.jumpBuffer = jumpBufferTime aw.jumpBuffer = jumpBufferTime