Get touch n as x,y
Posted: Sun Jun 21, 2020 12:53 pm
Does GET TOUCH N AS X,Y only work with screen coordinates?
I was trying to get it to work with a sprites coordinates, in a SPRITE BEGIN, SPRITE END.
GRAPHICS
GRAPHICS CLEAR 1,1,1
N$="mysprite"
SPRITE N$ BEGIN 200,100
GRAPHICS CLEAR 0,1,0
SPRITE END
SPRITE "mysprite" AT 800,400
SPRITE "mysprite" SHOW
SPRITE "mysprite" BEGIN
LOOP:
GET TOUCH 0 AS x,y
IF y > 0 AND y < 50 THEN
GRAPHICS CLEAR 1,0,0
END IF
GO TO LOOP
SPRITE END
I was trying to get it to work with a sprites coordinates, in a SPRITE BEGIN, SPRITE END.
GRAPHICS
GRAPHICS CLEAR 1,1,1
N$="mysprite"
SPRITE N$ BEGIN 200,100
GRAPHICS CLEAR 0,1,0
SPRITE END
SPRITE "mysprite" AT 800,400
SPRITE "mysprite" SHOW
SPRITE "mysprite" BEGIN
LOOP:
GET TOUCH 0 AS x,y
IF y > 0 AND y < 50 THEN
GRAPHICS CLEAR 1,0,0
END IF
GO TO LOOP
SPRITE END