; Cls Example ; ----------- Graphics 640,480,0,2 SetBuffer BackBuffer() clearing=1 angle#=0 While Not KeyDown(1) ; Space toggles whether we clear the screen each frame If KeyHit(57) Then clearing=1-clearing ; Cls wipes the drawing buffer clean; skip it and drawings pile up If clearing Then Cls ; A ball circling the screen centre angle=angle+2 Color 128+Sin(angle)*127,200,128-Sin(angle)*100 Oval 300+Cos(angle)*180,220+Sin(angle)*140,40,40,1 ; Black panel keeps the overlay readable when trails build up Color 0,0,0 Rect 0,0,640,44,1 Color 255,255,255 Text 0,0,"Space: toggle Cls on/off Esc: exit" If clearing Then Text 0,20,"Cls ON - each frame starts clean" Else Text 0,20,"Cls OFF - old frames remain as trails" EndIf Flip Wend End