Drawing a line

This forum is currently in read-only mode.
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • Hello folks! I was wondering if there is a good way to generate a line between two points. I have a character spawning a sprite at his location, and dropping a second sprite vertically until it hits the ground.

    I just needed to make a white line connecting the two. My current plan was to measure the distance between the points (which would share the same X, as it dropped only vertically), and then use that to tile a white tileable background.

    Better way?

    Thanks for any feedback!

  • Unless you need a texture, the line object should work.

  • Line object.

    Action set start X, set start Y to one of your sprite hotspot.

    Set end X, set end Y to the other.

    Each frame, move your objects and set the values of the line again.

    And if you still need the distance between the sprites you can get it using the system/math expression "Distance between points".

    (Or substracting spriteB.Y by spriteA.Y)

    I hope it helps.

    Edit: Ninja'd...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm newish to construct, so I'm gonna feel my way through using the line tool now. Thanks! Didn't even pay attention to it on the list.

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