JewelianPerez_27
Member
So my goal is to make a prize tile similar to the coin in Mario, where you collect 100 and get an extra life. While I am able to get the Prize counter (HUD element 0) to count up currently, the Lives counter (HUD element 1) does not update when I collect 100 prizes. Can anyone see what I'm doing wrong here?
Thanks.
Thanks.
Code:
;;; prize tile
LDA updateScreenData
AND #%00000100
BEQ +doScript
RTS
+doScript
LDA scrollOffsetCounter
BEQ +doIt
RTS
+doIt
CPX player1_object
BEQ +isPlayer
JMP +notPlayer
+isPlayer
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; BELOW WILL CHANGE TILE AT COLLISION.
ChangeTileAtCollision #$E7, #$00
;MACRO AddValue arg0, arg1, arg2, arg3
;arg0 = how many places this value has.
;arg1 = home variable
;arg2 = amount to add
;arg3 = what place value is receiving the addition?
;;; 0 = ones place, 1 = tens place, 2 = hundreds place, etc.
UpdateHudElement #$00
INC myPrizes
AddValue #$01, myPrizes, #$0, #$00
LDA myPrizes
CMP #100 ;; one more than the max
BEQ +addLives
JMP +notHundredYet
+addLives
UpdateHudElement #$01
INC myLives
LDA myLives
AddValue #$01, myLives, #$00, #$00
; LDA #$00 ;; normalize the value to 00 if it got bigger than 100
; STA myPrizes
;+dontNormalizeValue
AddValue #$07, myScore, #$1, #$02
UpdateHudElement #$06
+notHundredYet
+notPlayer