diff --git a/examples/camera/main.go b/examples/camera/main.go index 4dde8802c..3542744e8 100644 --- a/examples/camera/main.go +++ b/examples/camera/main.go @@ -148,10 +148,14 @@ func (g *Game) Update(screen *ebiten.Image) error { } if ebiten.IsKeyPressed(ebiten.KeyQ) { - g.camera.ZoomFactor -= 1 + if g.camera.ZoomFactor > -240 { + g.camera.ZoomFactor -= 1 + } } if ebiten.IsKeyPressed(ebiten.KeyE) { - g.camera.ZoomFactor += 1 + if g.camera.ZoomFactor < 240 { + g.camera.ZoomFactor += 1 + } } if ebiten.IsKeyPressed(ebiten.KeyR) {