LOCATE decides the location to print text string on the screen.
If you touch sprite, TOUCHING will be printed on the screen, and if you release sprite, TOUCHING will be erased (overwritten by space).
You can figure it out soon if you try removing LOCATE.
If you don't need to move sprite, remove IF - ENDIF above WEND.
I've applied "TOUCH OUT TM,TX,TY" to detect coordinates of stylus. While you don't touch bottom screen, TM will keep zero. And I've applied "SPHITRC(TX,TY,1,1)" to detect collision between stylus and sprite. If SPHITRC detects collision, SPHITRC will return the management number of the sprite.
"EOL" stands for "End Of Lines" i.e. the end of sentence data.
If "EOL" is found by IF statement in line 5 of this code, SmileBASIC will stop executing.
If you remove "EOL", an error will occur.
You can add sentence data as many as you like above DATA "EOL".
C=0:FADE #BLACK
WHILE TRUE:VSYNC 1
IF C==0 THEN
CLS:READ ST$
IF ST$=="EOL" THEN FADE 0:END
LOCATE 0,0:?ST$
FADE 0,120
ENDIF
IF C==240 THEN FADE #BLACK,120
C=(C+1)MOD 360
WEND
DATA"COULD YOU REFER TO"
DATA"THIS CODE?"
DATA"EOL"