Compare to judge movement direction

Get help using Construct 2

Post » Fri Mar 22, 2013 12:50 am

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.
Posts: 4
Reputation: 2,515

Post » Fri Mar 22, 2013 1:23 am

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 capxKyatric2013-03-22 01:24:04
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Posts: 7,358
Reputation: 73,460

Return to How do I....?

Who is online

Users browsing this forum: Daniel Cotorogea, josgertz and 16 guests