OPTION SHOW OFF OPTION ESCAPE OFF OPTION C_COORDS dim x as int dim x1 as int dim y as int Sub redraw_mario pagecopy 1, 0, x1, y, 20, 20 'erase mario from old x,y with the background move 1,x,y 'paint mario redraw 1 x1 = x 'set the old x to the current x redraw show ' show page 0 end sub Sprite 0, "background.pic" Sprite 1, "mario.pic" page 1 'switch to page1 move 0, 0, 0 ' paint the background to page 1 redraw 0 page 0 ' back to page 0 move 0, 0, 0 redraw 0 ' paint the background to page 0 ' initialize mario’s position x=0 x1=x y=50 move 1, x, y 'paint mario redraw 1 redraw show 'show page 0 to the user while true if key(#KEY_LEFT) then x=x-1 redraw_mario endif if key(#KEY_RIGHT) then x=x+1 redraw_mario endif if key(#KEY_SPACE) then exit program wend