aboutsummaryrefslogtreecommitdiff
path: root/draw.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2025-07-09 00:27:32 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2025-07-09 00:27:32 +0200
commit1bae69b2fdbcf35641d5d4a403cfb6261e34297d (patch)
treee7cb590384602e06aeaff75a930055a2f96a8811 /draw.go
parent8216f68ff8516cebc961028f8b8a87c1684dc15a (diff)
Spawn units
Diffstat (limited to 'draw.go')
-rw-r--r--draw.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/draw.go b/draw.go
index 9af35f5..90c1134 100644
--- a/draw.go
+++ b/draw.go
@@ -29,5 +29,15 @@ func (e *Entity) Draw(g *Game, screen *ebiten.Image) {
Size: 40,
}, op)
}
+ if e.Spawn.IsEnabled {
+ spawnText := fmt.Sprintf("%d", len(e.Spawn.Value.Requests))
+ op := &text.DrawOptions{}
+ op.GeoM.Translate(float64(e.Position.Value.X+5), float64(e.Position.Value.Y+70))
+ op.ColorScale.ScaleWithColor(color.White)
+ text.Draw(screen, spawnText, &text.GoTextFace{
+ Source: g.FaceSource,
+ Size: 40,
+ }, op)
+ }
}
}