Increase player movement speed

This commit is contained in:
Trevor Slocum 2022-07-19 14:00:17 -07:00
parent e32a821c6a
commit d98203af2f
1 changed files with 3 additions and 3 deletions

View File

@ -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
}