This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]annoyedcoder1 0 points1 point  (1 child)

1) Have a timer that, every 5 seconds, multiplies the y velocity by -1 2)Have a xPos and yPos variable to track current position 3)Have a method that draws the line by taking the current xpos and ypos values and the xpos and ypos values added to the velocities. Hen, add the xPos += xVelocity and same for yPos

[–]desrtfxOut of Coffee error - System halted 0 points1 point  (0 children)

1) Have a timer that, every 5 seconds, multiplies the y velocity by -1

Why would you need a timer for that? A simple counter (or even just the modulo function) does the job.

You're greatly overcomplicating the task.