how do i get the left side of an object

Get help using Construct 2

Post » Tue Oct 07, 2014 1:25 pm

hi,
how do i get the point position on this picture ?
Untitled1.png

Untitled1 - Copy.png

what is the formula ?
as you can see i want the left side point (x and y) position from the object..
i want to create that point ..
the distance of that point from the object is a variable like "mydistance"
and i want to set another variable like "myangle" and get the other point from object too .. like top point of object (always get the top point of an object (object angle doesn't matter) )
like variable myangle = 90 then i get the position of point from right side of object
thanks
You do not have the required permissions to view the files attached to this post.
B
16
S
6
Posts: 243
Reputation: 1,755

Post » Tue Oct 07, 2014 1:48 pm

Set Point X Sprite.X+cos(Sprite.Angle+Point.myAngle)*Point.myDistance
Set Point Y Sprite.Y+sin(Sprite.Angle+Point.myAngle)*Point.myDistance

Or if I understood this correctly
(always get the top point of an object (object angle doesn't matter) )
like variable myangle = 90 then i get the position of point from right side of object

Set Point X Sprite.X+cos(270+Point.myAngle)*Point.myDistance
Set Point Y Sprite.Y+sin(270+Point.myAngle)*Point.myDistance
Note that angle 0 is to the right.
B
34
S
9
G
3
Posts: 517
Reputation: 5,246

Post » Tue Oct 07, 2014 5:32 pm

Katala wrote:Set Point X Sprite.X+cos(Sprite.Angle+Point.myAngle)*Point.myDistance
Set Point Y Sprite.Y+sin(Sprite.Angle+Point.myAngle)*Point.myDistance

Or if I understood this correctly
(always get the top point of an object (object angle doesn't matter) )
like variable myangle = 90 then i get the position of point from right side of object

Set Point X Sprite.X+cos(270+Point.myAngle)*Point.myDistance
Set Point Y Sprite.Y+sin(270+Point.myAngle)*Point.myDistance
Note that angle 0 is to the right.

yes... its good and working ...
thank you very much ...
B
16
S
6
Posts: 243
Reputation: 1,755


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 24 guests