diff options
author | davidovski <david@davidovski.xyz> | 2024-04-22 17:54:21 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2024-04-22 17:54:21 +0100 |
commit | e4c0edeacb2c5829f864e116b68f6cad175141b3 (patch) | |
tree | 88ebcb9dd06affb1e525f807e3a40b864dd0865b /main.go | |
parent | d57ab031de3987ead9c06c48c8a5ad18a9de860c (diff) |
paper-style art
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -36,6 +36,7 @@ const ( audioFadeIn = 0.999 sampleRate = 44100 + shadowOffset = 1 ) var ( @@ -405,10 +406,7 @@ func (g *Game) Draw(screen *ebiten.Image) { g.surface.Fill(color.Alpha16{0x9ccf}) DrawBackground(g.surface, g.time) - op := &ebiten.DrawImageOptions{} - op.GeoM.Translate(float64(g.offsetX), float64(g.offsetY-2)) - - g.surface.DrawImage(g.tilemap.surface, op) + g.tilemap.Draw(g.surface, float32(g.offsetX), float32(g.offsetY-2)) for i := len(g.objects)-1; i >= 0; i-- { obj := g.objects[i] @@ -432,12 +430,11 @@ func (g *Game) Draw(screen *ebiten.Image) { } } + screen.DrawImage(g.surface, &ebiten.DrawImageOptions{}) + screen.DrawImage(g.surface, &ebiten.DrawImageOptions{}) - op = &ebiten.DrawImageOptions{} - PostProcess(g.surface, g.shaderName, g.time) + PostProcess(screen, g.shaderName, g.time) - op = &ebiten.DrawImageOptions{} - screen.DrawImage(g.surface, &ebiten.DrawImageOptions{}) ebitenutil.DebugPrint(screen, fmt.Sprintf("tps: %.4f", ebiten.ActualFPS())) } |