example/platform: Modify jump height

This commit is contained in:
Hajime Hoshi 2015-02-04 03:15:22 +09:00
parent 16e5b3f37e
commit 3ff3866da1

View File

@ -76,9 +76,9 @@ func (g *Game) Update() {
g.jumpKeyState = 0 g.jumpKeyState = 0
} }
if ebiten.IsKeyPressed(ebiten.KeyLeft) { if ebiten.IsKeyPressed(ebiten.KeyLeft) {
g.player.x -= 2 * unit g.player.x -= 1.5 * unit
} else if ebiten.IsKeyPressed(ebiten.KeyRight) { } else if ebiten.IsKeyPressed(ebiten.KeyRight) {
g.player.x += 2 * unit g.player.x += 1.5 * unit
} }
if g.inAir() { if g.inAir() {
g.player.ay = unit g.player.ay = unit
@ -86,6 +86,7 @@ func (g *Game) Update() {
g.player.ay -= int(0.5 * unit) g.player.ay -= int(0.5 * unit)
} }
} else if g.jumpKeyState == 1 { } else if g.jumpKeyState == 1 {
g.player.vy = 0
g.player.ay = -10 * unit g.player.ay = -10 * unit
} else { } else {
g.player.vy = 0 g.player.vy = 0