Having an issue writing a tile script for breaking tiles with sprite weapon...
It works when standing on top of the tile, but not when standing next to it.
I'm unsure how to tell it
If spriteWeapon_x == this._x...
(Basically I just want to be able to break bricks with my crowbar)
At the moment, I got this:
LDA #TILE_SOLID ; loads tile
STA tile_solidity; stores solid
LDA crowbar ; loads crowbar var
CMP #%00000100 ; got it ?
BNE stillsolidA ; if you don't have it go away
LDA currentWeapon ; loads selected weap
CMP #$02 ; is it the crowbar ?
BNE stillsolidA ; if not, go away
LDA gamepad ; obviously
CMP #%00000010 ; b button pressed?
BNE stillsolidA ; if not, kick rocks
LDA #$00 ; but if it is, load new tile
STA tile_solidity ; and make it notSolid
ChangeTileAtCollision #$00, #$00
stillsolidA:
It works when standing on top of the tile, but not when standing next to it.
I'm unsure how to tell it
If spriteWeapon_x == this._x...
(Basically I just want to be able to break bricks with my crowbar)
At the moment, I got this:
LDA #TILE_SOLID ; loads tile
STA tile_solidity; stores solid
LDA crowbar ; loads crowbar var
CMP #%00000100 ; got it ?
BNE stillsolidA ; if you don't have it go away
LDA currentWeapon ; loads selected weap
CMP #$02 ; is it the crowbar ?
BNE stillsolidA ; if not, go away
LDA gamepad ; obviously
CMP #%00000010 ; b button pressed?
BNE stillsolidA ; if not, kick rocks
LDA #$00 ; but if it is, load new tile
STA tile_solidity ; and make it notSolid
ChangeTileAtCollision #$00, #$00
stillsolidA: