When two image sprites touch, they always move to two sprite images that touch … how to avoid moving if they touch
your problem is also called “sprite cannibalism”. You can find info and a solution here.
https://groups.google.com/forum/#!msg/mitappinventortest/FuVKBNJwjfg/srrPgAmTCgAJ
Taifun
every time I give a speed point I confused why the image sprites to move? and when point colled I don’t give the speed image sprites don’t move when they touch
Sorry, I don’t understand what you mean.
Want to show an example?
Example i touch coordinate x 10 y 10 if image follow touch coordinate more or less x5 y5 then speed more slow until to do point x 10 y 10
Still can’t understand what you want. If what you need is to make the sprite speed slow down as it gets closer to the target, then use the blocks I gave in this post: Simple Mathematics
Yes like that i mean
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
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:
- Set INTERVAL to 0.
- If it’s possible always use SPEED and HEADING to move sprites instead of calculating x,y.
- 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?