5kids2feed
Well-known member
Hi friends,
I would like to put a countdown timer in the hud of my maze project. Countdown from 60 or maybe 100. Then to warp to whatever the screen properties says when the timer ends. What would be the best way to go about doing that?
EDIT:
Updated with working code thanks to Dale!
put in HandleGameTimer script::
and put this in your Post Screen Load:
and modify to your game! (look below for Dale's explanation)
I would like to put a countdown timer in the hud of my maze project. Countdown from 60 or maybe 100. Then to warp to whatever the screen properties says when the timer ends. What would be the best way to go about doing that?
EDIT:
Updated with working code thanks to Dale!
put in HandleGameTimer script::
Code:
;;; handle game timer
LDA gameTimerTicks
CLC
ADC #$01 ;how fast to run
STA gameTimerTicks
BCC +normalwhatever
;;Joe's create monster script we're canceling out
;;#$80, #$80, #$10 #$00
;;x, y, what object, what state
SubtractValue #$02, myTimer, #$1, #$00
;;arg0 = how places value has
;;arg1 - home variable
;;arg2 = amount to subtract
;;arg3 = what place value is receiving subtaction
UpdateHudElement #$05
+normalwhatever
LDA gameTimerLo
ADC #$00
STA gameTimerLo
LDA gameTimerHi
ADC #$00
STA gameTimerH
;; checking the value of the timer:
LDA myTimer_10
BNE +notEnded
LDA myTimer
BNE +notEnded
;; now 00
;; what we do:
;; execute a WARP !!!
WarpToScreen warpToMap, warpToScreen, #$01
+notEnded:
and put this in your Post Screen Load:
Code:
;; initialize the Timer to 60
LDA #$0
STA myTimer
LDA #$6
STA myTimer_10
and modify to your game! (look below for Dale's explanation)
Last edited: