Arctic Blizzard
New member
NESmaker 4.5.9 version - Game Timer
Here it is. This is the best I could do. And thanks again 5kids2feed & Dale_Coop!!! A game timer that counts down kind of Mario style where when it gets to zero it takes 1 life away and restarts the level. I'm still learning how to cut up code and use the macros for help. Its a fun learning process. Hope this script helps.
NESmaker 4.5.9 version
;;; Do Handle Game Timer My Lives (DALE COOP, 5kids2feed, ARCTIC BLIZZARD collab)
;;; What this script does is the Game Timer counts down. When timer reaches zero you will lose one life and the game will reset to the last continue point.
;;;Game Timer Ticks
LDA gameTimerTicks
CLC
ADC #$04 ;how fast the Game Timer will tick
STA gameTimerTicks
BCC +normalwhatever
;No Game Timer on Screen Flags.
LDA ScreenFlags00
AND #%01000000 ;; if "hide hud" is set.
BNE +normalwhatever ;; skip all the code related to myTimer
;;;Hud Game Timer Value
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 #$02
+normalwhatever
;;;Game Timer 1's, & 10's place
LDA gameTimerLo
ADC #$09 ;this represents the 1's place in the timer.
STA gameTimerLo
LDA gameTimerHi
ADC #$09 ;this represents the 10's place in the timer.
STA gameTimerHi
;;; checking the value of the Game Timer:
LDA myTimer_10
BNE +notEnded
LDA myTimer
BNE +notEnded
;; when Game Timer reaches 00.
;; this is what will happen. Level will start over and you will lose one life.
ChangeActionStep player1_object, #$07
;arg0 = what object?
;arg1 = what step?
JSR doChangeActionStep
;;Level will start over and you will lose one life.
+notEnded:
;;;;Special Thanks to NESmaker Community; Dale Coop & 5Kids2feed for helping to create this script.
Here it is. This is the best I could do. And thanks again 5kids2feed & Dale_Coop!!! A game timer that counts down kind of Mario style where when it gets to zero it takes 1 life away and restarts the level. I'm still learning how to cut up code and use the macros for help. Its a fun learning process. Hope this script helps.
NESmaker 4.5.9 version
;;; Do Handle Game Timer My Lives (DALE COOP, 5kids2feed, ARCTIC BLIZZARD collab)
;;; What this script does is the Game Timer counts down. When timer reaches zero you will lose one life and the game will reset to the last continue point.
;;;Game Timer Ticks
LDA gameTimerTicks
CLC
ADC #$04 ;how fast the Game Timer will tick
STA gameTimerTicks
BCC +normalwhatever
;No Game Timer on Screen Flags.
LDA ScreenFlags00
AND #%01000000 ;; if "hide hud" is set.
BNE +normalwhatever ;; skip all the code related to myTimer
;;;Hud Game Timer Value
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 #$02
+normalwhatever
;;;Game Timer 1's, & 10's place
LDA gameTimerLo
ADC #$09 ;this represents the 1's place in the timer.
STA gameTimerLo
LDA gameTimerHi
ADC #$09 ;this represents the 10's place in the timer.
STA gameTimerHi
;;; checking the value of the Game Timer:
LDA myTimer_10
BNE +notEnded
LDA myTimer
BNE +notEnded
;; when Game Timer reaches 00.
;; this is what will happen. Level will start over and you will lose one life.
ChangeActionStep player1_object, #$07
;arg0 = what object?
;arg1 = what step?
JSR doChangeActionStep
;;Level will start over and you will lose one life.
+notEnded:
;;;;Special Thanks to NESmaker Community; Dale Coop & 5Kids2feed for helping to create this script.
Last edited: