Why image sprites follow canvas touched?

Use those blocks in my post to calculate the distance between the sprite and the touched point in the canvas.
If the distance is greater than, let’s say 50, then set the speed to 10.
if it’s lower than 50 but greater than 25, set the speed to 8.
if it’s lower than 25 but greater than 15, set the speed to 4.
Etc, etc.

Play with those values and see which one makes the effect look better.

Work italo thank you​:joy:

I got problem now.
Why does the movement move to another point, but it doesn’t look smooth and seems to vibrate in the image of the spirit?

Did you set the sprite interval to 0?

yes I have given interval 0 if given a slow sprite image the more visible the vibration

Post an image of your relevant blocks, please.

That block is for when Firebase Data change. I don’t know how to work with Firebase, sorry. And I don’t understand what this has to do with sprite animations either.

I use fire base for coordinte other player… When i speed at less one seema to vibrate interval 0 …

Well, I don’t know what to say. If you have to wait for information to download from Firebase to update the sprite position, then it will not be fast. Like I said, I don’t know how Firebase works, never used it, so I don’t know if that’s going to be fast enough or not.

When iam not use fire base same vibrate to
Is any trick for smooth canvas moving italo?

The only tricks I have:

  1. Set INTERVAL to 0.
  2. If it’s possible always use SPEED and HEADING to move sprites instead of calculating x,y.
  3. Set SPEED of sprites to a high number (10 or more).
    Keep processes in between frames to the minimum.

I see there’s a lot in that block to process, and it repeats 3 times! Try to find a way of reducing that, check if there’s any unnecessary process that can be made or evaluated after the sprite movement.

You understand your blocks better than anyone. I’m sure you will find the solution.

Oke i will try…
Can the sprite image be included with a decode 64-bit encode photo link?

I don’t know. I never used that.

1 Like

ImageSprite Picture, is a png or jpg, yes but not the object ImageSprite

I have used image not sprite it can include decode 64 …when i try image sprite it cant do…maybe any other way

I have found a way to not lag using time every time set time 0 is very smooth but now I have a problem how do I get to the point calculation of the sprite image using time calculation?

I don’t know what kind of calculation you need, explain more.

such as image sprites to touch points but do not use speed for image sprites only use the clock timer to subtract or add to points of x y image sprites

I don’t know what kind of movement you want your sprites to perform. The calculations can be anything you want. Post an example of what you want the sprites to do.

1 Like