Breakable Block depending on Screen Type/Game Object

tbizzle

Well-known member
Here is a script for a breakable block that will break when a certain Game Object is set to a certain Screen Type. Right now the code is specific to my game. You will have to change it to work with your game. Right now it is setup to work with four different game objects/screen types. You can add or comment out as you see fit. Enjoy!

Code:
;;; SOLID FOR ALL OBJECTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      
        
LDA ObjectUpdateByte   
ORA #%00000001
STA ObjectUpdateByte
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

LDA Object_type,x
CMP #$01
BNE AAA
LDA screenType
CMP #$01
BEQ +
JMP +end
    AAA:
LDA Object_type,x
CMP #$03
BNE BBB
LDA screenType
CMP #$02
BEQ +
    BBB:
LDA Object_type,x
CMP #$0A
BNE CCC
LDA screenType
CMP #$04
BEQ +
    CCC:
LDA Object_type,x
CMP #$07
BNE DDD
LDA screenType
CMP #$05
BEQ +
    DDD:   
    
    RTS
    
    +
LDA Object_frame,x
LSR
LSR
LSR
AND #%00000111


ChangeTileAtCollision #34, #00
        


JMP +end
;PlaySound #sfx_explode 
 ;PlaySound #sfx_bbat 
 +end:
 
Top Bottom