How do you prevent sprites from overlapping when they move around the canvas using blocks or designer?
I am using this block for all the sprites.
How do you prevent sprites from overlapping when they move around the canvas using blocks or designer?
I am using this block for all the sprites.
If you have your sprites set to NOT âpasses throughâ (in designer), theyâll bounce off each other. Is that what youâre looking for, or something else?
They donât pass through each other. They move to a random new location.
Do you want the link to my Thunkable project?
I guess I donât understand what youâre trying to do?
I think you can do something like this:
Repeat while [touching Sprite9]
move [Sprite9] to x [random integer from 50 to 350] y [random integer from 50 to 350]
Or just use this block and put your move block inside it:
Thanks for your replies. Iâll share my project, and you can give me suggestions on that. Sorry for not responding before.
https://x.thunkable.com/copy/760af3a0cc45dcd849ef5958138026d0
If you live test, you will find the error that I want fixed.
I already used the âWhen __ collides with __â block in my code.
How do I do this?
This is what I was thinking but Iâm not sure it will work. I think you would need all sprite images to be in a single sprite.
Thank you so much!!!
The âdistance between __ and __â block is just what I need. Good idea!
Thank you so much @tatiang and @catsarisky for putting in the time to help me.
@tatiang, I liked your solution but it is going to take more time than I need.
So I have a better idea. I can temporarily move my character sprite outside the range the presents are moving and then move it back again when they are done moving.
Hope this can be a reference to other people who are facing the same issue.
I will edit this post to include a link to WDC #16, where you can see my updated app and remix it.