Inverting controls

  • Hi,

    How would I set up an event sheet so that when the player collides with an object the controls are reversed.

    I.E: Right becomes left and vice versa

  • Assuming you are using platform movement, untick the option to use default controls. Create a boolean flag in the player called "direction". Set up your player movement something like:

    If key pressed (whatever key you choose for moving left) and boolean "direction" not set, then simulate platform pressing left.

    Do the same thing for moving right.

    Then set up a collision event between the player and the object that sets the boolean flag for "direction". You would then need to put in an event like:

    If key pressed (whatever key you choose for moving left) and boolean "direction" set, then simulate platform pressing right (this reverses normal movement). Do the same thing for moving right (which reverses movement so the player moves left).

  • Thanks it worked!!

    However, when i try to add a timer it negates the boolean flag.

    The way I have it set up is:

    On collision with object - Destroy object, set boolean to false, start timer of 15sec, set boolean to true.

    When I don't set the timer it works.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've created a little C3P file to show you how to do what you want. I can't post active links yet, but download the following file and take a look:

    brandonwhitton.com/InvertedControls.c3p

  • Thanks

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