Skip to content

Commit 19dcd51

Browse files
committed
client/game/hud: Clean the text of Win/Lowe
The text was keept between games without beeing true, it needed to be clean
1 parent b47817a commit 19dcd51

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

client/game/hud.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,17 @@ func (hs *HUDStore) Draw(screen *ebiten.Image) {
261261
if cp.Lives == 0 {
262262
hs.winLoseTextW.Label = "YOU LOST"
263263
hs.winLoseTextW.GetWidget().Visibility = widget.Visibility_Show
264+
} else if hs.winLoseTextW.GetWidget().Visibility != widget.Visibility_Hide {
265+
hs.winLoseTextW.Label = ""
266+
hs.winLoseTextW.GetWidget().Visibility = widget.Visibility_Hide
264267
}
265268

266269
if cp.Winner {
267270
hs.winLoseTextW.Label = "YOU WON!"
268271
hs.winLoseTextW.GetWidget().Visibility = widget.Visibility_Show
272+
} else if hs.winLoseTextW.GetWidget().Visibility != widget.Visibility_Hide {
273+
hs.winLoseTextW.Label = ""
274+
hs.winLoseTextW.GetWidget().Visibility = widget.Visibility_Hide
269275
}
270276

271277
hs.ui.Draw(screen)

server/assets/wasm/maze-wars.wasm

2 KB
Binary file not shown.

0 commit comments

Comments
 (0)