aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-02-24 13:43:10 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-20 15:52:12 +0200
commitd46f56fa0d8f2217cf9716839ee83b93f2ee8485 (patch)
tree5f84901c17a2c057db5cc8430b693f1cd6fa2b7a
parentc32ea7248fbb2c895c5d41e86fa6efb89df5d721 (diff)
downloadmuhqs-game-d46f56fa0d8f2217cf9716839ee83b93f2ee8485.tar.gz
muhqs-game-d46f56fa0d8f2217cf9716839ee83b93f2ee8485.zip
run screen updates after handling user input
The reordering of the update logic hopefully results in a more responsive UX.
-rw-r--r--go/client/game.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/go/client/game.go b/go/client/game.go
index 37e44d77..8d7fa74b 100644
--- a/go/client/game.go
+++ b/go/client/game.go
@@ -507,9 +507,6 @@ func (g *Game) updateHighlight() {
func (g *Game) Update() error {
g.handlePlayerNotifications()
- g.updateHighlight()
- g.updatePassButton()
-
if inpututil.IsMouseButtonJustPressed(ebiten.MouseButtonLeft) {
x, y := ebiten.CursorPosition()
obj := g.findObjectAt(x, y)
@@ -540,7 +537,14 @@ func (g *Game) Update() error {
}
}
- return g.Collection.Update()
+ if err := g.Collection.Update(); err != nil {
+ return err
+ }
+
+ g.updateHighlight()
+ g.updatePassButton()
+ return nil
+
}
func (g *Game) Draw(screen *ebiten.Image) {