1 decade ago by coreysnyder
I've written games in the past and in some cases I would just use a draw function to draw a line from point A to point B. How is this accomplished in Impact? Do you override the draw() function?
Essentially what I'm trying to do is put a dot where the user first clicks, and draw a line to a dot where the user moves their mouse to. Or on mobile clicks and drags a finger to. So if you clicked and drug your finger down and to the left, you'd see a dot where you initially clicked, and a line drawn to a dot under your cursor.
As far as the dots go, I was just going to create a dot (a sprite with a dot) entity and spawn it under the mouse click. Then spawn a second dot entity which will track the to the users mouse. Where I'm stuck is how to draw a line between the two. Any help would be appreciated.
Essentially what I'm trying to do is put a dot where the user first clicks, and draw a line to a dot where the user moves their mouse to. Or on mobile clicks and drags a finger to. So if you clicked and drug your finger down and to the left, you'd see a dot where you initially clicked, and a line drawn to a dot under your cursor.
As far as the dots go, I was just going to create a dot (a sprite with a dot) entity and spawn it under the mouse click. Then spawn a second dot entity which will track the to the users mouse. Where I'm stuck is how to draw a line between the two. Any help would be appreciated.