Help please how make image sprite follow touch on the canvas?

How make image spirit follow touch?

??
I don’t know, tell them to follow the light at the end of the tunnel??

giphy (1)

3 Likes

Ok, in a serious note, use the block ImageSprite.PointInDirection X,Y
X,Y will be the touch coordinates. Then give it some speed and the sprite will move towards the touched point.

3 Likes

I blank …can u show a litlle block?

It’s one block really. Just put it inside the When Canvas touched event, get the x and y and put it in the block. That’s it.

1 Like

I was do that but the img sipirit not follow jus stay … JI

Thank you italo for it i work amazing :face_with_hand_over_mouth: :face_with_hand_over_mouth: :joy:

1 Like

Italo i need more help to you about coordinat other screen is deferent how is make same position if we touch screen??

Save the x,y position in a TinyDB and read it when the other screen is opened, or pass the values as a list of two items with the block “Open Another Screen with Value”.

1 Like

Italo, I mean other screen by other phone not same phone how is do that become same position to the other phone if resolution deferent screen

I never made something like that. You mean both phones connected somehow (Bluetooth, etc) and you have to show the same canvas in both at the same time?

Yes like on line game even deferent resolution the coordinate like same moving

Well, I’m going to throw some ideas I would try in your place, since I never did that before.
There’s 2 approaches, I would try the easier one: Check which device has the smallest screen and make the canvas in the other device the same size.

The more complex one would involve math and converting the absolute x,y positions into relative ones and it’s not super complicated but I think you should try the first one and see if it works.

1 Like

That work​:joy: thank you… Italo

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.