How to change direction when MID points are over..

Get help using Construct 2

Post » Thu Aug 29, 2013 7:13 pm

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
B
11
S
3
Posts: 44
Reputation: 823

Post » Fri Aug 30, 2013 10:07 am

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?
B
11
S
3
Posts: 44
Reputation: 823

Post » Fri Aug 30, 2013 10:58 am

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.



I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Aug 30, 2013 11:07 am

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.
B
11
S
3
Posts: 44
Reputation: 823


Return to How do I....?

Who is online

Users browsing this forum: BadMario, stevenode, Yahoo [Bot] and 6 guests