Compare to judge movement direction

0 favourites
  • 2 posts
From the Asset Store
Rotate & Animation for 16 Direction & Mouse Direction
  • Hey, first of all thanks for helping out if you have/intend to.

    I'm making a very simple platformer, based on this tutorial:

    So I'm trying to set up a slightly more accurate way to tell my sprite when to mirror itself. I was thinking to use 'compare X coord' to dictate whether or the player has moved left or right, I'm fairly sure this is an effective solution I just don't know how to properly write the comparison.

    Could you help me out here? Thanks again.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Have you checked this tutorial too ?

    I think the way it's proposing is the most simple and is accurate since it relies on the player's inputs.

    If you want to check though if the character has moved since the last tick, you need to:

    Begin by keeping the current coordinates in a variable (global or instance variable, your choice)

    Have the player input move the character

    Then test if the current character X position is higher or less than the stocked value.

    I don't believe this is more accurate than mirroring or not on player's input...

    Your version as a capx

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