mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
example/platform: Modify jump height
This commit is contained in:
parent
16e5b3f37e
commit
3ff3866da1
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user