Im working on a project where you can make your own levels, and right now the blocks making up the ground are clones in a list. But what I want to know is if the clones can get deleted and then loaded via the list.
Not directly, but you can record the position, direction, size, costume name, etc., and create a custom clone from this information.
You can use the database library to store/load a level list
I think I got it to work now, but now I’m trying to make a menu where you can save, load and make new levels
i have done this before, i think the best way to save is to broadcast a msg (save), and every clone add their info int a glogal var, next, save the global variable…
if you want to save a list, don’t forget to use json of yourList and split by json to load it proprely
okay
yum
yum
I’m not sure that I’m understanding the issue here, but I feel like the root of the problem is that you want the clones to be permanent rather than temporary.
There are two fundamentally different ways that clones can be used in a project. The more common way is that you want a bunch of duplicates of a sprite just while the program is running; the canonical example is the bricks in the wall in a Breakout game. But another way is that you want a permanent hierarchy of similar but not identical sprites; the canonical example is the small group of ghosts in a Pacman game, each with its own behaviors, but always the same few ghosts, not randomly appearing ones.
In Snap!, we make the default assumption that clones you make “by hand” in the user interface, right-clicking on a sprite in the sprite corral and choosing “clone” from the menu, are permanent, while clones that are made by your running program, with the A NEW CLONE OF MYSELF block, are temporary. But you can change this default assumption in your program; when you make a clone you can say
(Hover over the “MY
If you make a clone permanent, it gets its own icon in the sprite corral, and it doesn’t disappear when you click the stop sign or the green flag. Permanent clones can therefore be saved with the project, and will still be there when you load the project again.
There is this topic on saving and loading sprite positions, sizes, directions, etc.
If you build a level editor, i think you don’t want to use permanent clone… Maybe i’m wrong…
Maybe @random_guy can share his project with us so we can figure out the best way to achieve this
You can just hide the ones that aren’t relevant to this level. :~)
Yeah, with a zillion of sprites
here is the link: Snap! Build Your Own Blocks
you can save and load into the stage (danger ang ground
i optimized code in danger and ground sprites
Take a look !
I tried it out and it works perfectly! thanks.
Edit: when I tried coding a save/load button this kept happening:
can you “save as” over platformer plz so i can look at this…





