Sometimes, I want my screen to be triggered when I killed on the monsters (special rooms, boss rooms, ...) I already had a trigger screen tile type but it was not exactly the behavior I wanted. I could have trigger the screen when all monster killed... but it would have that behavior in all my screens, and don't want that either...
So I made a special tile type: Trigger Screen If No Monster... When the player walks on that tiles, it trigger the screen, ONLY if there is no monsters on screen:
1/ Make a new "TriggerScreenIfNoMonster.asm" script (in your "Routines\Basic\ModuleScripts\TileScripts" folder):
2/ Assign that script to an unused "Tile Colission XX" element in the "Project Settings > Script Settings"
3/ In th e"Project Settings > Project Labels", rename the corresponding Tile Type to "Trigger Screen If No Monster":
4/ Now make your assets and place them at strategic points, near the screen exits (where the player will walk on before leaving the screen).
VoilĂ
PS: and here's the "TriggerScreenIfNoMonster.asm" script, to use with the Two Players module:
So I made a special tile type: Trigger Screen If No Monster... When the player walks on that tiles, it trigger the screen, ONLY if there is no monsters on screen:
1/ Make a new "TriggerScreenIfNoMonster.asm" script (in your "Routines\Basic\ModuleScripts\TileScripts" folder):
Code:
;;Triggers the Current Screen If No Monster:
CPX player1_object
BEQ +
JMP ++
+
CountObjects #%00001000, #$00 ;; count monsters.
LDA monsterCounter
CLC
BNE ++
;;; Trigger the screen only if no monster on screen:
TriggerScreen screenType
++
2/ Assign that script to an unused "Tile Colission XX" element in the "Project Settings > Script Settings"
3/ In th e"Project Settings > Project Labels", rename the corresponding Tile Type to "Trigger Screen If No Monster":
4/ Now make your assets and place them at strategic points, near the screen exits (where the player will walk on before leaving the screen).
VoilĂ
PS: and here's the "TriggerScreenIfNoMonster.asm" script, to use with the Two Players module:
Code:
;;Triggers the Current Screen If No Monster:
CPX player1_object
BEQ +
CPX player2_object
BEQ +
JMP ++
+
CountObjects #%00001000, #$00 ;; count monsters.
LDA monsterCounter
CLC
BNE ++
;;; Trigger the screen only if no monster on screen:
TriggerScreen screenType
++