Mercurial > hg > serpentron
changeset 10:5bb39198a9be
Always wait before starting next round.
author | Mikhail Kryshen <mikhail@kryshen.net> |
---|---|
date | Sat, 02 Apr 2016 12:24:52 +0300 |
parents | 8c7e910cb328 |
children | a6bde9cde187 |
files | src/Serpentron.st |
diffstat | 1 files changed, 8 insertions(+), 6 deletions(-) [+] |
line diff
1.1 --- a/src/Serpentron.st Tue Mar 29 22:15:05 2016 +0300 1.2 +++ b/src/Serpentron.st Sat Apr 02 12:24:52 2016 +0300 1.3 @@ -33,10 +33,9 @@ 1.4 self updateScore. 1.5 (score anySatisfy: [ :each | each >= pointsToWin ]) 1.6 ifFalse: [ 1.7 - self status: (self winnerDOM: color) << ' won the round.'. 1.8 - timeoutId := window 1.9 - setTimeout: [ self nextRound ] 1.10 - after: 2000. 1.11 + self 1.12 + status: (self winnerDOM: color) << ' won the round.'; 1.13 + nextRound. 1.14 ^ self ]. 1.15 self status: self scoreDOM. 1.16 timeoutId := window 1.17 @@ -120,8 +119,11 @@ 1.18 ! 1.19 1.20 nextRound 1.21 - self status: self scoreDOM. 1.22 - field start: field players. 1.23 + timeoutId := window 1.24 + setTimeout: [ 1.25 + self status: self scoreDOM. 1.26 + field start: field players ] 1.27 + after: 2000. 1.28 ! 1.29 1.30 randomizePlayerColors