Restrict player to one direction

  • #1, by ygmantellFriday, 01. September 2017, 16:04 3 years ago
    So in one scene in my game (only one scene) I want the player character to only move left.  So, even if the player clicks anywhere to the rigth of the character, nothing will happen.

    In other words (if that didn't make any sense...) kinda like the original Super Mario Bros.  You can move (or, in this case, click) to the rigth, but not backwards.  This would be for  sort of intractive cutscene, where the character will just walk to the left, but I figured this would be more impactful if the player did it (even though they have no choice and have to click to make the player move left)
    I apologize if that didn't make any sense...

    Is this possible?
    Thanks!

    Great Poster

    274 Posts


  • #2, by mikael32225Friday, 01. September 2017, 23:14 3 years ago
    Haven't tried anything like it myself, but you should be able to check with each movement click If: “Character is aligned to” (right), then “Change character speed” to 0. Just make sure to set it back to normal on every legal move, so it moves at all.

    Another solution that might be worth considering is having the whole screen be one big button set to “Send Character to position”. That is with every click no matter where it is, you send the character a few steps to the left, along the path that you want the character to walk. In my mind it would look better (as the player wouldn't have to fight the weirdness of not being able to walk in the other direction), but it might not fit the type of experience you are after either.

    Newbie

    42 Posts

  • #3, by ygmantellFriday, 01. September 2017, 23:52 3 years ago
    That is true, Haven't really thought about that...
    I probably am going to go with your second method.
    Thanks!

    Great Poster

    274 Posts

Write post