summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2024-04-22 17:54:21 +0100
committerdavidovski <david@davidovski.xyz>2024-04-22 17:54:21 +0100
commite4c0edeacb2c5829f864e116b68f6cad175141b3 (patch)
tree88ebcb9dd06affb1e525f807e3a40b864dd0865b /main.go
parentd57ab031de3987ead9c06c48c8a5ad18a9de860c (diff)
paper-style art
Diffstat (limited to 'main.go')
-rw-r--r--main.go13
1 files changed, 5 insertions, 8 deletions
diff --git a/main.go b/main.go
index dea148d..a2a8276 100644
--- a/main.go
+++ b/main.go
@@ -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()))
}