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