Sonic 1 - Change anim' on obj' (ideally)

Discussion in 'Discussion and Q&A Archive' started by Niko, May 31, 2015.

  1. Niko

    Niko All's well that ends well, right? Member

    Joined:
    Mar 1, 2014
    Messages:
    245
    Location:
    $C800
    Okay, so the idea here is that I want it so when Sonic (Aka: the player object) lands on my custom platform object**, Sonic will change to another animation until he jumps off of it, or gets pushed off from momentum or a moving object***. 

    So, my question is, should I program the object to change Sonic's animation, or Sonic to change animations when he's on the object?
    And, if it's to make the object change Sonic, can I get just the single line of code that will change him to use the**** SonAni_LookUp / id_LookUp?

    Notes:

    **(not going to be exact, since it would be a big spoiler)

    *** (such as moving spikes, a solid moving platform, ect')
    **** (for example, since the animation I'm using is a hint)

    _____

    Thank you for reading, even if you haven't an answer.  
     
  2. N30member

    N30member non-pro user btw Member

    Joined:
    Feb 15, 2014
    Messages:
    216
    Location:
    Kazakhstan
    You should program the object to change Sonic's animation. For example, how does it work in spring object (Obj41 routine):

    Code:
    		move.b	#$10,$1C(a1)	; use "bouncing" animation
     
  3. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    Yes, the above method is the most ideal. If you were to check from the player object whether they are interacting in this and that way, it'd be much more complex and prone to fail. If you simply dedicate different subtype-routines to different "player states", things get easy to handle.

    Of course I can't say what exactly it is you're planning to do, but from your words I would suggest you simply expand Obj18 (the platform object) by more subtypes, doing what exactly you desire.
     
  4. Niko

    Niko All's well that ends well, right? Member

    Joined:
    Mar 1, 2014
    Messages:
    245
    Location:
    $C800
    @N30member, that makes it all super-easy, I should've looked at the spring object.
    Thank you!

    And, @Selbi, I agree about how making the player check for something would be a pain.
    Also, I want to thank you, Selbi, a whole lot, for your JumpDash code. I was going to make it so the player can bounce off of enemies and monitors,but I thought you covered that. Just more proof how skimpy my time online is when I first started making my hacks. 
    (I've already made text for the Credits to show your name for the code, and I plan on showing these credit-screens when I make the demo release. If not, I would just icnlude a long list of plain text in the post, and a "ReadMe" text file.)

    EDIT:
    I'm glad I started with re-locating the code in my ASM, first.
    SVN has it as:

            move.b    #id_Spring,obAnim(a1) ; use "bouncing" animation

    ID's by name are easier for me to work with, as far as time usage. 
     
    Last edited by a moderator: Jun 1, 2015