How to make Sonic curl into a ball when off ramps? [S1]

Discussion in 'Discussion & Q&A' started by Jefftastic, Aug 3, 2017.

Tags:
Thread Status:
Not open for further replies.
  1. Jefftastic

    Jefftastic n00blet Member

    Joined:
    Jul 23, 2017
    Messages:
    45
    Location:
    In Antartica
    Okay, so the problem is that I want Sonic to curl into a ball after shooting off ramps.

    Is there a way to make this happen?

    (using Hivebrain 2005 disassembly)
     
  2. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,016
    I'd assume so. The Sonic object's status variable has a bit which tracks whether Sonic's in the air or not. If you track down where that bit is set, you should find the code that runs when Sonic leaves the ground. From there, you can set the bit that indicates Sonic's in a ball, and change his animation to the curled one.
     
    Last edited: Aug 3, 2017
    Jefftastic likes this.
  3. Jefftastic

    Jefftastic n00blet Member

    Joined:
    Jul 23, 2017
    Messages:
    45
    Location:
    In Antartica
    Okay, so I found that there's a couple lines that tell sonic to change his animation frames from vertical running to horizontal after exiting ramps, I think if I could add a invincibility tick and change the line that loads the animation to play the roll animation it might work.
     
  4. Trinitronity

    Trinitronity Well-Known Member Member

    Joined:
    Sep 12, 2016
    Messages:
    94
    Actually, no.
    The game is programmed like that so as soon as Sonic uses the rolling animation, he automatically gets its properties as well.
     
  5. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    You can add some code in ObjectFall that checks if the object is Sonic (which can be done with cmpi.b #1,(a0)) and then if so, change to his falling animation. If you want it to be only when going off ramps, you will need check if his angle is greater than a certain value and less than the opposite of that value.
     
    KCEXE and Jefftastic like this.
Thread Status:
Not open for further replies.