Learn to Program with ZedLX

Free Online Programming Course for Beginners

Simple Motion [5/10]

This program draws a moving disc leaving a trail.
[Run the program]

To remove the trail, the screen needs to be erased before drawing the disc at each new position.

Exercise:

  1. Change the sleep time in the sleepMs call to value 500, in order to view each animation frame separately. In this example, the difference between frames is so small that this effect is barely visible.

Loading...