create code
/* Creates twenty variables, 'prev_x[1]' and 'prev_y[1]' through
'prev_x[10]' and 'prev_y[10]'. The first is the current location
of the object and each of the others represents a previous "ghost"
of the object, with number 10 being the latest one (10 steps ago).
*/
for (ii = 1; ii < 10; ii +=1;) {
prev_x[ii] = 0;
prev_y[ii] = 0;
}
step when going fast
// Update the current object's positions.
prev_x[1] = x;
prev_y[1] = y;
// Update each of the "ghosts".
for (ii = 10; ii > 1; ii -= 1;) {
prev_x[ii] = prev_x[ii-1];
prev_y[ii] = prev_y[ii-1];
}
draw
// Draw the sprite and its 9 "ghosts" at logical alpha values.
for (ii = 1; ii < 10; ii += 1;) {
draw_sprite_ext(sprite_index,-1,prev_x[ii],prev_y[ii],1,1,0,c_white,0.5*(10-ii)/10);
}