Skip to content

Commit f384ff7

Browse files
committed
Added countdown timer for player turns.
1 parent 60f9054 commit f384ff7

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

Client/Atari/FujiLlama.bas

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ colorTheme=-1
204204
UNIT=1
205205
JSON_MODE=1
206206
URL$=""
207-
208207
BaseURL$="N:https://fujillama.spysoft.nz"
209208
' BaseURL$="N:HTTP://192.168.68.100:8080"
210209
QUERY$=""$9B
@@ -244,6 +243,8 @@ next i
244243
move$=""
245244
PlayerIndex=0
246245
dealt=0
246+
countdown =60
247+
jiffy=0
247248

248249
' Error variable
249250
_ERR=0
@@ -294,6 +295,20 @@ DO
294295
@DrawGameState
295296
ENDIF
296297
@ReadKeyPresses
298+
if playerStatus(PlayerIndex)=1
299+
jiffy=jiffy+1
300+
if jiffy=50
301+
jiffy=0
302+
countdown=countdown-1
303+
ENDIF
304+
@POS 36,17: @PrintVAL CountDown:@Print &" "
305+
if countdown<=0
306+
move$="F"
307+
@BadBeep
308+
@PlayMove
309+
playerStatus(PlayerIndex)=0
310+
ENDIF
311+
ENDIF
297312
if GameStatus(tablenumber)=4 then @ShowResults
298313
UNTIL GameStatus(tablenumber)=5
299314
@ShowGameOver
@@ -536,8 +551,9 @@ PROC CheckVaildMove _move
536551
ENDIF
537552
Next a
538553
if Move$<>""
539-
@GoodBeep
554+
@GoodBeep
540555
@DoMainPlayerAnimation
556+
@POS 13,24: @Print &" "
541557
@PlayMove
542558
playerStatus(PlayerIndex)=0
543559
ELSE
@@ -869,6 +885,10 @@ PROC ReadGameState
869885
INC INDEX ' If read last field of a Player Array, increment index and read next player
870886
ENDIF
871887
loop
888+
if playerStatus(PlayerIndex)=1
889+
countdown=60
890+
jiffy=0
891+
ENDIF
872892
ENDPROC
873893

874894
proc SetPlayerSlots
@@ -1094,6 +1114,7 @@ PROC DrawGameState
10941114
@POS 5,25:@Print &"H-HELP C-COLOR E-EXIT Q-QUIT"
10951115
if PlayerStatus(PlayerIndex)=1
10961116
@POS 13,24: @Print &"YOUR TURN NOW"
1117+
@POS 26,17: @Print &"TIME LEFT:"
10971118
@DrawDrawButton 2,20
10981119
@DrawFoldButton 37,20
10991120
else

Client/Atari/bin/FujiLlama.xex

151 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)