How to change direction when MID points are over..

0 favourites
  • 4 posts
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • Hi friends,

    I am trying to redirect the palyer object when it comes over to the arrow object. But it redirects when ever player's bounds are touched to the arrow's bounds. I want to redirect it when the Mid Points are overlaped. So when ever the player object is fully on the arrow object.

    Is there any one who can help me about that?

    Best

  • I still could not solve it. Mid points means centers of them.

    Still it turns when ever it touchs the other object.

    Really there is no one who did something like that before?

  • if player.x,player.y = arrow.x,arrow.y?

    problem is that player is probably moving and the x and y will not completely be the same.

    so maybe you could use if distance(player.x,player.y,arrow.x,arrow.y) < 2 (change this number to see if it has to be bigger or smaller)

    To make the turn at exactly the right place you could first set the player position to the arrow posdition before changing direction. The small jump will probably be hardly noticable.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    thank you for the advice. I will use the second one. I will change the player position to arrow position first and turn it. Thank you.

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