Lesson goal: Make an animated-GIF with a line

Previous: Make a point move | Home | Next: Make a circle move

In the last lesson, you learned how to make small dots move around in an animated-GIF.

In this lesson, you'll learn how to make animations with lines.
gif_line(x1,y1,x2,y2,color)
Move the mouse over a dotted box for more information.

Now you try. Make a line move!

Type your code here:

 
1
id = gif_start()
2
for i=-100,100,5 do
3
 gif_cls(0)
4
 gif_line(i,-50,i,50,2)
5
 gif_line(-50,i,50,i,3)
6
 gif_add_frame(5)
7
end
8
gif_end()
9
gif_play(id)

See your results here: