offparkway
Active member
Trying to create a health pickup. I made the object and identified it as a pickup/powerup. it shows up in-game, and I can pick it up (but it doesn't do anything yet).
So I went into the pickup script, and copied the code for the myAmmo pickup. I followed the same code, and have it comparing to item 05 (my health pickup) and made it set myLives to 3. I also added the code to play a sound (which works already for myAmmo, but not this time for myLives).
All looks correct to me (I'm not a coder), but I'm getting 3 compiler errors from doHandleObjectCollisions_nonLethal.asm saying "branch out of range", on lines 254, 261,and 263
Here's my code:
CMP #$05
BNE +notThisPickup
PlaySound #sfx_woot
LDA #$03
STA myLives
UpdateHudElement #$03
JMP +endPickups
+notThisPickup:
So I went into the pickup script, and copied the code for the myAmmo pickup. I followed the same code, and have it comparing to item 05 (my health pickup) and made it set myLives to 3. I also added the code to play a sound (which works already for myAmmo, but not this time for myLives).
All looks correct to me (I'm not a coder), but I'm getting 3 compiler errors from doHandleObjectCollisions_nonLethal.asm saying "branch out of range", on lines 254, 261,and 263
Here's my code:
CMP #$05
BNE +notThisPickup
PlaySound #sfx_woot
LDA #$03
STA myLives
UpdateHudElement #$03
JMP +endPickups
+notThisPickup: