start bastext 1025 start tok64 d64-hxnElI 10 REM *** detect demonstration *** 20 a=32:SPROG a:REM * set pointer * 30 SPROG "{.*9}*******{.*8}" 31 SPROG "{.*7}***********{.*6}" 32 SPROG "{.*6}*************{.*5}" 33 SPROG "{.*6}****{.*3}******{.*5}" 34 SPROG "{.*5}****..**..*****{.*4}" 35 SPROG "{.*5}****..*********{.*4}" 36 SPROG "{.*5}****..**..*****{.*4}" 37 SPROG "{.*6}****{.*3}******{.*5}" 38 SPROG "{.*6}*************{.*5}" 39 SPROG "{.*6}*************{.*5}" 40 SPROG "{.*6}*.*********.*{.*5}" 41 SPROG "{.*7}*.*******.*{.*6}" 42 SPROG "{.*7}*..*****..*{.*6}" 43 SPROG "{.*8}*..***..*{.*7}" 44 SPROG "{.*8}*..***..*{.*7}" 45 SPROG "{.*9}*..*..*{.*8}" 46 SPROG "{.*9}*..*..*{.*8}" 47 SPROG "{.*10}*****{.*9}" 48 SPROG "{.*10}*****{.*9}" 49 SPROG "{.*10}*****{.*9}" 50 SPROG "{.*11}***{.*10}" 70 REM ** set hi-res screen ** 80 SCREEN 1:COLOR 3,0 90 SPRITE1,a:EXPANDy1:EXPANDx1 100 PRINT"{clear}":SPRCL1,2 110 SMOVE1TO150,0 120 p=PEEK(53278)+PEEK(53279):REM ** clear 'detect' ** 130 REM ** draw hills ** 140 FORx=0TO319 STEP4:s=(s+1)AND3:y=130+30*SIN(x/30) 150 DRAW x,199 TO x,y STEPs:NEXT 170 SPRITE1,a:EXPANDy1:EXPANDx1 180 SPRCL1,6 190 SMOVE1TO150,0 200 CHAR4,0,20:PRINT"{right}this is a {reverse on}detect{reverse off} demo. when the sprite" 210 PRINT"{right}hits the hills, it will move from left" 220 PRINT"{right}to right, then start all over again." 230 FORi=0TO200:SMOVE1TO150,i:REM move until 240 DETECT(1)GOTO 500 :REM it hits something 250 NEXT:END:REM 'end' never reached 500 PRINT"{down}{right*3}{.*11}hit detected{.*11}" 510 FORx=0TO345STEP2:y=100+30*SIN((x-21)/30) 520 SMOVE1TOx,y:NEXT:GOTO100 stop tok64 (bastext 1.0)