From d46f56fa0d8f2217cf9716839ee83b93f2ee8485 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 24 Feb 2023 13:43:10 +0100 Subject: run screen updates after handling user input The reordering of the update logic hopefully results in a more responsive UX. --- go/client/game.go | 12 ++++++++---- 1 file 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) { -- cgit v1.2.3