baardbi
Well-known member
I have a tiny problem with the monster lock tile. I works exactly as it's supposed to, but when I go back to the screen where the monster lock was it's still there. I mean it's "triggered" in the sense that the solid collision has changed, but the graphics go back to the way it was when it was solid...
Here's a little video of the problem:
Here is the code for KilledLastMonster_DC.asm:
Here's the code for Handle_CheckForMonsters_DC.asm:
Here's the code for CheckTriggeredTilesLoad_DC.asm:
Here's a little video of the problem:
Here is the code for KilledLastMonster_DC.asm:
Code:
;; Remove all the monster locks:
ChangeAllTiles #COL_MONSTER_LOCK, #$00, #TILE_MONSTER_LOCK_OFF, #$00
ChangeAllTiles #COL_MONSTER_LOCK, #$00, #TILE_MONSTER_LOCK_OFF, #$01
Here's the code for Handle_CheckForMonsters_DC.asm:
Code:
;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;
;; monster bit is: #%00001000
;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;To change collision type and graphic
CountObjects #%00001000, #$00 ;; count monsters.
LDA monsterCounter
CLC
BEQ doNoMoreMonsterCode
JMP stillMonstersOnScreen_onScreenload
doNoMoreMonsterCode
;;; all of the tiles you would like to change when this screen is loaded.
;;; do this routine for:
;;; FIRST, GET RID OF LOCKS:
LDA update_screen
BNE screenIsOffForMonsterCheck
JMP doScreenOnMonsterCheck
screenIsOffForMonsterCheck:
;LDA showingNametable
;STA temp
;ChangeAllTilesDirect #COL_MONSTER_LOCK, #$00, #TILE_MONSTER_LOCK_OFF, temp
JMP stillMonstersOnScreen_onScreenload
doScreenOnMonsterCheck:
;;;;;===================
stillMonstersOnScreen_onScreenload:
;;;; end what to do if no more objects
Here's the code for CheckTriggeredTilesLoad_DC.asm:
Code:
LDA temp
CMP #TILE_INDEX_LOCK
BNE ++
LDA #TILE_OPENDOOR ;; what tile do you want under lock?
STA temp
JMP notPath
++
LDA temp
CMP #TILE_MONSTER_LOCK
BNE ++
LDA #TILE_MONSTER_LOCK_OFF ;; what tile do you want under Monster Lock?
STA temp
JMP notPath
++
LDA temp
CMP #TILE_KEY
BNE ++
LDA #$00 ;; what tile do you want under Key?
STA temp
JMP notPath
++