diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-02-24 13:43:10 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-01-27 16:43:51 +0100 |
| commit | 7788121beb6b9dd8540d4345e8e841830ff2c490 (patch) | |
| tree | 23d48c65c2f85dcb499af8f69e0bc52ca6fcf644 /go | |
| parent | 375a764b9333817f8913527423faba024abfb996 (diff) | |
| download | muhqs-game-7788121beb6b9dd8540d4345e8e841830ff2c490.tar.gz muhqs-game-7788121beb6b9dd8540d4345e8e841830ff2c490.zip | |
run screen updates after handling user input
The reordering of the update logic hopefully results in a more
responsive UX.
Diffstat (limited to 'go')
| -rw-r--r-- | go/client/game.go | 12 |
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) { |
