How to get angle beetween 2 objects

Get help using Construct 2

Post » Mon Mar 03, 2014 10:50 am

Hi guys!!! i want to see if you guys can help me :)
see the image below please =) i hope it opens for you
https://www.dropbox.com/s/nl0tum3kr2b2d6m/ArcherAngle.jpg

see i want to make an archer have 8 directions where to shoot at... with 8 animations... to shoot at the player
but i dont know how to know the angle beetween the player and the enemy , so if the player is in front to put the animation to frontal, and if the player is at 45 angle to put an animation of the archer pointing up a bit... like in the image... please help :)

thanks in advance!!!
You do not have the required permissions to view the files attached to this post.
B
23
S
6
G
3
Posts: 316
Reputation: 3,461

Post » Mon Mar 03, 2014 12:20 pm

angle(player.x,player.y,enemy.x,enemy.y)
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Tue Mar 04, 2014 4:28 am

lennaert wrote:angle(player.x,player.y,enemy.x,enemy.y)

thanks for you reaply and that expresion will give me a number?? leet me try :) thanks a lot!!!
B
23
S
6
G
3
Posts: 316
Reputation: 3,461

Post » Tue Mar 04, 2014 10:12 am

It will give the angle(A value)
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests