I think there is something missing
On my iPad-1 the line is slowly growing, but not moving.
I made the following example, which is also in the PDF-manual:
' moving lines
GRAPHICS
sw=SCREEN_WIDTH()
sh=SCREEN_HEIGHT()
DRAW SIZE 5
DO
i+=1
DRAW DASH 20,10,5,10 PHASE i*5
GRAPHICS LOCK
GRAPHICS CLEAR 0,0,0
DRAW CIRCLE sw/2,sh/2 SIZE sw/4
DRAW RECT 2,2 TO sw/3,sh/3
DRAW LINE 2,sh/2 TO sw,sh
GRAPHICS UNLOCK
i%=9
GET TOUCH n AS x,y
UNTIL x>-1 AND y>-1
END
You are right, I was too hasty It moves very slow.
Now the problem is that I don't understand the code.
There is no cycle-period in the value of 'k', it is constantly growing instead. What is e.g. phase 890 on a line of length 250.
In my example the phase steps with 5 pixels until the end of the pattern (9*5=45 pixels) and repeats that again and again.
Can you please explain how 'your' line moves?
Dutchman wrote:
Can you please explain how 'your' line moves?
Of course!
Actually "phase" is always valid. Even negative - just moves in another direction. For "phase", remainder of division (what you have done as i%=9) is always performed internally, so you may not bother about this
OK, smart!
I changed in your code 'k+=1' to 'k+=5' and that clarified why it moved so slowly.
Thanks, I will make a remark in the manual about that automatic cycling.