Method for Stopping Endless Player Recoiling (4.5.9. Adventure Module)

tbizzle

Well-known member
I used this method to stop my player from forever recoiling after taking damage from monsters in the Adventure Module. If your project can benefit from it, then awesome! It seems to work for me pretty well.
So in your "Subroutines\doHandlePhysics_AdventureBase.asm" right after this bit of code at around line 495:

Code:
LDA directionByte
ORA #%10000000
AND #%10111111 ;; "left"
STA directionByte

Insert this new code underneath it:

Code:
CPX player1_object           
BNE +continueP                       
StopMoving temp, #$FF, #$00             
    +continueP:

Now to enter it two more times. The second time right after this bit of code at around line 523:

Code:
LDA directionByte
ORA #%11000000 ;; "right"
STA directionByte

Insert this bit of code underneath the above code:

Code:
CPX player1_object           
BNE +continueP                       
StopMoving temp, #$FF, #$00           
    +continueP:

And then again underneath this bit of code at around line 688:

Code:
JSR doHandleBounds
JMP skipPhysics
    doneWithH:

Insert this bit of code:

Code:
CPX player1_object           
BNE +continueP                       
StopMoving temp, #$FF, #$00           
    continueP:

Another tutorial that works great long with this is tutorial for adding an "invincibility timer".

 
Top Bottom