Simple Guide: How to collide with water when hurt (Sonic 1)

Discussion in 'Tutorials Archive' started by Mike B Berry, Aug 18, 2012.

Thread Status:
Not open for further replies.
  1. Mike B Berry

    Mike B Berry A grandiose return Member

    Joined:
    Jun 6, 2012
    Messages:
    377
    Location:
    New places, newer motivation
    This guide will make it possible for Sonic to collide with when he is hurt.


    Firstly go to this position:



    Code:
    
    ; ---------------------------------------------------------------------------
    
    ; Sonic when he gets hurt
    
    ; ---------------------------------------------------------------------------
    
    Obj01_Hurt:	; XREF: Obj01_Index
    
    jsr SpeedToPos
    
    addi.w #$30,$12(a0)
    
    btst #6,$22(a0)
    
    beq.s loc_1380C
    
    subi.w #$20,$12(a0)
    
    loc_1380C:
    
    bsr.w Sonic_HurtStop
    
    bsr.w Sonic_LevelBound
    
    bsr.w Sonic_RecordPos
    
    		; <--
    
    bsr.w Sonic_Animate
    
    bsr.w LoadSonicDynPLC
    
    jmp DisplaySprite
    
    


    Next; we add this line in the area provided:





    Code:
    bsr.w Sonic_Water



    And you should have this:



    Code:
    
    ; ---------------------------------------------------------------------------
    
    ; Sonic when he gets hurt
    
    ; ---------------------------------------------------------------------------
    
    Obj01_Hurt:	; XREF: Obj01_Index
    
    jsr SpeedToPos
    
    addi.w #$30,$12(a0)
    
    btst #6,$22(a0)
    
    beq.s loc_1380C
    
    subi.w #$20,$12(a0)
    
    loc_1380C:
    
    bsr.w Sonic_HurtStop
    
    bsr.w Sonic_LevelBound
    
    bsr.w Sonic_RecordPos
    
    bsr.w Sonic_Water ; <--
    
    bsr.w Sonic_Animate
    
    bsr.w LoadSonicDynPLC
    
    jmp DisplaySprite
    
    
    Thats all there is to it really. Make a build of your rom and test it out.


    Heres a video demonstrating the fix of collision, RHS' tribute and me pointing out a terrible feature with the water table technique. that will be posted in the the discussion topic later... Anyway:


    [media]http://www.youtube.com/watch?v=14GuMsHzA_g&feature=youtu.be[/media]

    [/CODE]
     
    Last edited by a moderator: Aug 18, 2012
    Nat The Porcupine likes this.
  2. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    Hate to burst your bubble, but someone has already put a guide like this out there. Well, for Sonic 2 at least. No idea about Sonic 1.
     
  3. Mike B Berry

    Mike B Berry A grandiose return Member

    Joined:
    Jun 6, 2012
    Messages:
    377
    Location:
    New places, newer motivation
    Well, I have never seen one for Sonic 1, but since they share nearly the same codes, It is very relivant that there is one out there. But at leas thist guide is as simple as the other guide I posted. But I value the information none the less.
     
    Last edited by a moderator: Aug 18, 2012
Thread Status:
Not open for further replies.