I am currently trying to write a block which gets destroyed on contact with a sprite. I am using the subroutine $BEB0 to create a blank tile on the block's position and I am loading the sprite's position into $98-9B (the player's position).
Everything is working out except the fact that the tile gets always created on the left from the sprite.
Is there a way to detect if the sprite touches the left or right side of the block or is there a different way to destroy the block?
Here is the my code (I have left out the block where the player's position is pushed into the stack and pulled from the stack)
Everything is working out except the fact that the tile gets always created on the left from the sprite.
Is there a way to detect if the sprite touches the left or right side of the block or is there a different way to destroy the block?
Here is the my code (I have left out the block where the player's position is pushed into the stack and pulled from the stack)
Code
LDA $14D4, X ;\ XBA ; | LDA $D8, X ; | Store sprite Y position REP #$20 ; | into player Y position STA $98 ; | SEP #$20 ;/ LDA $14E0, X ;\ XBA ; | LDA $E4, X ; | Store sprite X position REP #$20 ; | into player X position STA $9A ; | SEP #$20 ;/ LDA #$02 ;\ STA $9C ; | Gernerate blank tile JSL $BEB0 ;/