Here's a small piece of code to modify the object collision box, to use when crouching (to avoid bats, projectiles, lasers, ... any monsters)
This is just an example, feel free to modify it for your needs...
1) In the "Project Setting > Project Labels", change the last "Monster Action Step Flag" to "Skip top object collision":
2) In the "Project Setting > Script Settings", under "SuRoutines", modify the "Handle Object Collision" script (I suggest to duplicate it and assign that duplicated one instead of the original)
At the beginning of that script, around the beginning (between line 50 to 75 depending of the module used) you will find the lines :
Before those lines, add this block of code:
You should now have a script that looks like that:
3) Modify your Player's action step (the one you used for "crouch") and set the "Skip top object collision" flag:
4) I think this step you may have already done it, but... now, I will just add an input script to my HOLD Down button. Script that will just change my player to his courting state (action step 4, in my case).
My "crouch.asm" input script looks like that:
...and is assigned to my HOLD Down button:
VoilĂ , now you should be able to skip your enemie's projectiles.
This is just an example, feel free to modify it for your needs...
1) In the "Project Setting > Project Labels", change the last "Monster Action Step Flag" to "Skip top object collision":
2) In the "Project Setting > Script Settings", under "SuRoutines", modify the "Handle Object Collision" script (I suggest to duplicate it and assign that duplicated one instead of the original)
At the beginning of that script, around the beginning (between line 50 to 75 depending of the module used) you will find the lines :
Code:
TYA
PHA
Code:
;; dale coop, skip top object collision
LDA Object_vulnerability,x
AND #%10000000
BEQ +skip
LDA self_bottom
SEC
SBC self_top
LSR
CLC
ADC bounds_top
STA bounds_top
+skip:
You should now have a script that looks like that:
3) Modify your Player's action step (the one you used for "crouch") and set the "Skip top object collision" flag:
4) I think this step you may have already done it, but... now, I will just add an input script to my HOLD Down button. Script that will just change my player to his courting state (action step 4, in my case).
My "crouch.asm" input script looks like that:
Code:
TXA
STA temp ;; assumes the object we want to move is in x.
ChangeActionStep temp, #$04
RTS
VoilĂ , now you should be able to skip your enemie's projectiles.
Last edited: