This is how you would use Phaelax's function. I added some comments.
`First he named the type which he will name the array
type Vector2D
`Any array declared as this will have two parts -> x and y
`x is an integer
x as integer
`y is an integer
y as integer
endtype
sync on
rem make array
`The array starts off as small as it can be made -> 0
dim points(0) as Vector2D
`you will want to store it after a certain amount of time has passed
time=timer()
timetowait=50
numofpoints=50
`loop to store all the points in
repeat
sync
t=timer()
`if the timetowait has passed
if time+timetowait<t
time=t
`add the mouse coordinates using the function Phaelax made
addPoint(mousex(),mousey())
endif
`until there there are a certain amount of points stored.
until array count(points())=numofpoints
hide mouse
`draw lines between the points
for i=1 to array count(points())-1
ink rnd(16777215),0
line points(i).x,points(i).y,points(i+1).x,points(i+1).y
next i
sync : sync
`wait for user
wait key
`end it so that the debugger doesn't complain about hitting a function in the program
end
`Phaelax's function
function addPoint(x,y)
`it adds a place to the array
array insert at bottom points()
`i is the last place in the array (the one just created)
i = array count(points())
`points(i).x - the .x means that it is storing the value in the x type of the array
points(i).x = x
points(i).y = y
endfunction