Switch between active chars..

  • How do i switch between two player chars in a platformer?

    I have created a regular platform level that is about twice the width of the screen size and placed a sprite as player-character with the solid/scroll to/platformMP behaviours. Nothing fancy..

    Now i want to dump another sprite at the other end as second (inactive) character and have a button to switch between which character the player controls. Preferably since the other char may be offscreen the 'scroll to' behaviour could be switched between chars too?

    I would apreciate being pointed in the right direction or perhaps even an example?

    Greetz,

    Danny

  • the easiest way I could think of is have different animations within one sprite

  • But i want both to be present in the level at all times.. I mean the point of the game would be to bring both to a specific point or bring them together by moving them in turn and switching between them..

    (seemed like a fun concept to me) *nods

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • you can clone your sprite, ie have a second instance of it...

  • Here's a possible implementation

    The trick is to use a third object with the scroll to behavior, and switch between the characters, starting/stoping the user's input depending on which character is to be controlled.

    Simply cloning the character's instance is possible too, but sounds like way more trouble imo.

    And also, if both sprites have the scroll to behavior, the program will struggle to try to put the view on both at the same time.

  • Awesome stuff, thank you both Weishaupt and Kyatric for your help.

    The example shown by Kyatric does what i seek perfectly. *nods and smiles

    :)

  • Good way to learn having multiple conditions i must add..

    I am very happy now :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)