CLEAR ALL
TILEMAP 1 NEW 80,50
SPRITE 1 BIND TILEMAP 1 SHOW FIT
TARGET TILEMAP 1
' init
DOUBLE BUFFER
TBACKGROUND RGB(0,64,0)
INK 0
PUT RECT FILL 0,0,79,49,32
INK RGB(255,255,0)
FOR ANGLE=0 TO 360 STEP 0.5
    x=ROUND(40+10*COS(ANGLE*PI/180))
    y=ROUND(25+10*SIN(ANGLE*PI/180))
    PUT TILE x,y,102
NEXT ANGLE
a$=TCOPY$(30,15,50,35)
' animate
INK RGB(255,255,255)
x=RANGE(0,79):WHILE dx=0:dx=RANGE(0,6)-3:WEND
y=RANGE(0,49):WHILE dy=0:dy=RANGE(0,6)-3:WEND
DO
    TCLS
    TPASTE x,y,a$ MASK ALIGN 0,0
    SWAP BUFFERS
    x=x+dx:IF x<0 OR x>=TILEMAP.COLUMNS(1) THEN dx=-dx
    y=y+dy:IF y<0 OR y>=TILEMAP.ROWS(1) THEN dy=-dy
    PAUSE
LOOP WHILE INKEY$=""
