Hello,
I am really stuck.
The code below works perfectly on my laptop.
I use the mouse to click on the sprite and it disappears.
But when I broadcast it to my Android phone it shows the sprite moving around on the screen with the text as normal. The problem is that the input does not work. When I tap the screen on the sprite it should disappear but it does not detect the input. I just can't figure out why.
I would really appreciate any help with this.
'red_monster.png' file is attached
SetVirtualResolution ( 320, 480 )
setsyncrate(30,1)
CreateText (1, "Click on the monster" )
settextposition (1,25,120)
SetTextSize ( 1, 22 )
SetTextColor (1,255,255,255,255)
red_monster = LoadImage ( "red_monster.png" )
sprite1 = CreateSprite (red_monster)
setspritesize(sprite1,100,100)
SetSpriteShape(sprite1,2)
SetSpritePosition ( sprite1, 50,100)
SetSpritePhysicson ( sprite1,2 )
SetPhysicsGravity (10,10)
SetSpritePhysicsRestitution ( sprite1, 5.1 )
do
z# = getpointerpressed()
if z#=1
X#=getPointerX()
Y#=getPointerY()
A#=ScreenToWorldX(X#)
B#=ScreenToWorldY(Y#)
GetSpriteHitTest(sprite1,A#,B#) = 1
SetspriteVisible(sprite1,0)
endif
sync()
loop