Inform late joiners of time left.

When you join late, you find out exactly how many seconds you have left
in the game.
This commit is contained in:
Mike Mueller 2012-04-04 00:21:03 -07:00
parent 79082016ef
commit 1b1b5331ea
1 changed files with 4 additions and 0 deletions

View File

@ -478,6 +478,10 @@ class Worddle(BaseGame):
ignore=[nick])
if self.state == Worddle.State.ACTIVE:
self._display_board(nick)
time_left = int(round(self.end_time - time.time()))
self.announce_to(nick,
"%sLet's GO!%s You have %s%d%s seconds!" %
(WHITE, LGRAY, LYELLOW, time_left, LGRAY), now=True)
else:
self.announce_to(nick, 'Current Players: %s%s' %
(WHITE, (LGRAY + ', ' + WHITE).join(self.players)))