mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
examples/flappy: Bug fix: wrong calculation of rotating
This commit is contained in:
parent
f2e2f602c5
commit
ce2168c0d6
@ -371,10 +371,10 @@ func (g *Game) drawTiles(screen *ebiten.Image) {
|
||||
|
||||
func (g *Game) drawGopher(screen *ebiten.Image) {
|
||||
op := &ebiten.DrawImageOptions{}
|
||||
_, h := gopherImage.Size()
|
||||
op.GeoM.Translate(-float64(h)/2.0, -float64(h)/2.0)
|
||||
w, h := gopherImage.Size()
|
||||
op.GeoM.Translate(-float64(w)/2.0, -float64(h)/2.0)
|
||||
op.GeoM.Rotate(float64(g.vy16) / 96.0 * math.Pi / 6)
|
||||
op.GeoM.Translate(float64(h)/2.0, float64(h)/2.0)
|
||||
op.GeoM.Translate(float64(w)/2.0, float64(h)/2.0)
|
||||
op.GeoM.Translate(float64(g.x16/16.0)-float64(g.cameraX), float64(g.y16/16.0)-float64(g.cameraY))
|
||||
op.Filter = ebiten.FilterLinear
|
||||
screen.DrawImage(gopherImage, op)
|
||||
|
Loading…
Reference in New Issue
Block a user