aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.go b/main.go
index 150b57e..80574a2 100644
--- a/main.go
+++ b/main.go
@@ -42,12 +42,15 @@ func (g *Game) Update() error {
}
}
if inpututil.IsMouseButtonJustReleased(ebiten.MouseButtonLeft) {
+ // TODO: Drag & select
x, y := ebiten.CursorPosition()
tileClick := Point{x - soil.Position.X, y - soil.Position.Y}
+ canBeSelected := true
for _, p := range g.Persons {
p.IsSelected = false
if tileClick.In(p.CollisionBounds()) {
- p.IsSelected = true
+ p.IsSelected = canBeSelected
+ canBeSelected = false
}
}
}