;;; prize tile
LDA ObjectUpdateByte
ORA #%00000001
STA ObjectUpdateByte ;; makes solid
LDA updateScreenData
AND #%00000100
BEQ +doScript
RTS
+doScript
LDA scrollOffsetCounter
BEQ +doIt
RTS
+doIt
LDA Object_type,x
CMP #$01
BEQ +isPlayerWeapon ;; is it the player weapon? If not, skip. If so, continue on.
JMP +notPlayerWeapon
+isPlayerWeapon
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; BELOW WILL CHANGE TILE AT COLLISION.
PlaySound #sfx_explosion
ChangeTileAtCollision #$44, #$00
;MY_PRIZE = #$01 ;; change this to the type of object you want a prize block to create.
;MY_PRIZE_STATE = #$00 ;; change this to the state of the prize when it appears.
;MY_PRIZE_Y_OFFSET = #$00 ;; change this to how far above the prize box it should create this object.
;MY_PRIZE_X_OFFSET = #$01 ;; change this to how far to the right of the left side of the tile it should create this object.
;JSR doGetRandomNumber
;AND #%00001111 ;; now, we have a number between 0 and 15 ;; these are binary numbers
;BNE +notProjectileDrop
LDA tileX
AND #%11110000
CLC
ADC #$04
STA tempA
LDA tileY
AND #%11110000
SBC #$10
STA tempB
LDA Object_screen,x
STA tempC
;TXA
;PHA
;CreateObject tempA, tempB, #$04, #$00, tempC
CreateObjectOnScreen tempA, tempB, #$04, #$00, tempC
JMP +notPlayerWeapon
+notProjectileDrop
JSR doGetRandomNumber
AND #%00000111 ;; now, we have a number between 0 and 7
BNE +notProjectileDrop2
LDA tileX
AND #%11110000
CLC
;ADC #$04
STA tempA
LDA tileY
AND #%11110000
;SBC #$08
STA tempB
;LDA Object_screen,x
;STA tempC
;TXA
;PHA
CreateObject tempA, tempB, #$04, #$00, currentNametable
JMP +notPlayerWeapon
+notProjectileDrop2
LDA tileX
AND #%11110000
CLC
;ADC #$04
STA tempA
LDA tileY
AND #%11110000
;SBC #$08
STA tempB
;LDA Object_screen,x
;STA tempC
;TXA
;PHA
CreateObject tempA, tempB, #$04, #$00, currentNametable
+notPlayerWeapon