Browse Source

Increase player movement speed

main v1.1.0
Trevor Slocum 5 months ago
parent
commit
d98203af2f
  1. 6
      entity/player.go

6
entity/player.go

@ -16,10 +16,10 @@ import (
)
const (
playerVelocity = 60.0
playerVelocity = 120.0
playerGroundAccelTime = 0.1
playerGroundAccel = playerVelocity / playerGroundAccelTime
playerAirAccelTime = 0.25
playerAirAccelTime = 0.5
playerAirAccel = playerVelocity / playerAirAccelTime
fallVelocity = 900.0
)
@ -95,7 +95,7 @@ func playerUpdateVelocity(body *cp.Body, gravity cp.Vector, damping, dt float64)
xDir := 0.0
yDir := 0.0
if ebiten.IsKeyPressed(ebiten.KeyW) {
if ebiten.IsKeyPressed(ebiten.KeyW) && world.PlayerGrounded {
yDir -= 1
world.LastWalkDirU = true
}

Loading…
Cancel
Save