how do i get the left side of an object

0 favourites
  • 3 posts
From the Asset Store
A complete set of graphical user interface (GUI) to build 2D video games. With wood, nature, & jungle theme
  • hi,

    how do i get the point position on this picture ?

    [attachment=1:2lmcurt4][/attachment:2lmcurt4]

    [attachment=0:2lmcurt4][/attachment:2lmcurt4]

    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

  • 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

    [quote:n306uggl](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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

    [quote:2f8o8abu](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 ...

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