I am creating a basic app with a ball that is flung around the screen. Is there any way to make the ball leave a trail of color behind? Like the ball draws a line while it moves randomly around the screen.
--
It didnt work
--
You need to save the current x and y in variables called Prev_x and Prev_y.
Then everytime the ball is moved, draw a line from Prev_x, Prev_y to the current x and y of the ball. After the line is drawn, repeat (save x and y, etc.)
--
Then everytime the ball is moved, draw a line from Prev_x, Prev_y to the current x and y of the ball. After the line is drawn, repeat (save x and y, etc.)
--
Thanks for the suggestion! I tried that and made it with a procedure - see my screenshot.
The problem is, it still only draws little lines every time I fling the ball.
How do I save in order to repeat as you suggested?
--
The x,y saving and the drawing needs to be done inside a Clock.Timer event, set that timer to enabled when the ball is flung. Set the clock to 100 ms or anything that works for you.
--
--
댓글 없음:
댓글 쓰기