DarthAT
Member
Working on a Currency item pick / monster drop this morning. I have taken pieces from the maze tutorial prize code and added to the templet pickup script in my adventure base. It seems to be working, but when I pick up the item the math is not working out. For example, the following code adds 6 to my total (if I change arg3 to 01, it adds 15... what am I doing wrong? (For now I would like it to increment by 1 only)
Thank you for any help you can provide.
Code:
LDA Object_type,x
CMP #$07 ;;What object is your pickup? 00 - 0f
BNE +notThisPickup
;;;;;;;;;;;;;;;;;;;;;;;;; What do you want to do to the value?
;;;;;;;;;;;;;;;;;;;;;;;;; Increase? Decrease? Set it to a number?
;;;;;;;;;;;;;;;;;;;;;;;;; Here, we are setting myAmmo to 5.
LDA #$05
STA myCurrency
CPX player1_object
;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.
AddValue #$05, myCurrency, #$1, #$00
UpdateHudElement #$03
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;; Do we need to update the HUD to reflect this?
;;;;;;;;;;;;;;;;;;;;;;;;; If so, which element is the above variable represented in?
+notThisPickup:
JMP +endPickups
+notThisPickup:
CMP #$03
BNE +notThisPickup
Thank you for any help you can provide.