10 FRA%=0 20 DIM SCR%(2):SCR%(0)=SCREENWIDTH(0):SCR%(1)=SCREENHEIGHT(0) 30 ACCEL=0.5 40 GRA=0.3 50 BLOBSIZE=16 60 XS=SCR%(0)-16 70 YS=SCR%(1)-16 80 DIM LOCA(2):LOCA(0)=SCR%(0)/2:LOCA(1)=SCR%(1)/2 90 DIM SPEED(2):SPEED(0)=0.0:SPEED(1)=0.0 100 ALERT "HELP","D-PAD - movement of ball. Enjoy!","",1,5000:SLEEP 5000 110 MENUADD "Exit",7,1 120 MENU$=MENUITEM(0) 130 SETCOLOR 0,0,0 140 FILLRECT 0,0,SCR%(0),SCR%(1) 150 BALLX=LOCA(0)-BLOBSIZE/2:BALLY=LOCA(0)-BLOBSIZE/2 160 SETCOLOR 0,255,0 170 FILLARC LOCA(0),LOCA(1),16,16,360,360 180 SPEED(0)=SPEED(0)*0.999 190 SPEED(1)=SPEED(1)*0.999 200 SPEED(1)=SPEED(1)+GRA 210 LOCA(0)=LOCA(0)+SPEED(0) 220 LOCA(1)=LOCA(1)+SPEED(1) 230 IF LOCA(0)>XS THEN GOSUB 400 240 IF LOCA(0)<0 THEN GOSUB 500 250 IF LOCA(1)>YS THEN GOSUB 600 260 IF LOCA(1)<0 THEN GOSUB 700 270 IF LEFT(0) THEN SPEED(0)=SPEED(0)-ACCEL 280 IF RIGHT(0) THEN SPEED(0)=SPEED(0)+ACCEL 290 IF UP(0) THEN SPEED(1)=SPEED(1)-ACCEL 300 IF DOWN(0) THEN SPEED(1)=SPEED(1)+ACCEL 310 IF MENU$="Exit" THEN GOTO 800 320 REPAINT 330 FRA%=FRA%+1 340 GOTO 120 400 LOCA(0)=XS-(LOCA(0)-XS) 410 SPEED(0)=-0.8*SPEED(0) 420 SPEED(1)=0.9*SPEED(1) 430 RETURN 500 LOCA(0)=-LOCA(0) 510 SPEED(0)=-0.8*SPEED(0) 520 SPEED(1)=0.9*SPEED(1) 530 RETURN 600 LOCA(1)=YS-(LOCA(1)-YS) 610 SPEED(0)=0.9*SPEED(0) 620 SPEED(1)=-0.8*SPEED(1) 630 RETURN 700 LOCA(1)=-LOCA(1) 710 SPEED(0)=0.9*SPEED(0) 720 SPEED(1)=-0.8*SPEED(1) 730 RETURN 800 ALERT "Exit",STR$(FRA%)+" frames drawn, Thanks for playing.","",1,5000 810 SLEEP 5000 820 BYE