How do I make a restart button that clears all previous sprites?

Hello,

I am new to Thunkable and I spent the last 8 hours trying to code an asteroid game. I cannot figure how to make the old Asteroids go away. I’ve tried “remove all sprites in Asteroid Group” but it it still persists after I begin anew.

Here is a link to my project: Thunkable

I am new to this, so if you need to see the code another way, please let me know.

Thanks a lot

I don’t use the Canvas much so I could be wrong but I think what’s happening is that you are creating Asteroid Groups and then attempting to remove all sprites inside an Asteroid Group which is a single sprite group. So you might create a bunch of “Asteroid Groups” and then your remove blocking is only deleting one of them.

I’m not sure how you would fix this but you could try these blocks:

image

Or these blocks:

image

Thanks for the reply. I played around with a couple commands and functions and still couldn’t quite get it. I took your advice and went back to the “Asteroid Groups” and played around with it for a while. I found when I limit it to 2 asteroids I don’t have the problem. When I change it to “3+” I immediately get the problem of asteroids staying on the screen during the consecutive playthroughs. I even made another sprite, using the same code, and made that new sprite “1” just to see if it would give me the same problems… and it did. For whatever reason if there is more than 3 falling objects they linger on the screen after collision. There are no problems if the code is at 2 or less falling objects.

I tried some variations on the remove blocks and didn’t have any luck either. Hopefully someone else with more experience with sprites can help.

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