I personally think that the lack of sprite duplication is one the scratch's biggest disadvantages. I heard that before when scratch was in testing sprite duplication was taken out because people didn't know what to with the duplicated sprites.
But since the scratch program itself is becoming more complex (v1.3 will have arrays) why won't it have such a basic but extremely useful function? I even think that variables and arrays would be more difficult for people to understand as most people could probably use a "clone" block right away but few would be able to use variables.
The lack of sprite duplication forces people to make several copies of an identical sprite. This is both inefficient and time consuming. I remember spending hours just duplicating sprites and having to individually edit the code. I don't not think that manually making copies of a sprite is good programming practice and I also think that people should learn how to deal with duplicated sprites.
I think the pros of sprite duplication greatly outweigh the cons.
I would like to see other peoples' views on this.
Last edited by archmage (2008-07-26 01:51:38)
Offline
I think he means during gameplay
Offline
Colkadome wrote:
There IS sprite duplication you know. Just hold down ctrl or alt and click a sprite in the list below the stage.
What I mean, is that I want a way to duplicate sprites using code. Even though the copy tool help you make copies of a single sprite it is still a pain when you want 100 similar sprites in your project especially when each of these sprites need slight adjustments . There should be some sort of clone block.
It should be similar to this actionscript code
duplicateMovieClip(target, newname="", depth);
Say there is an enemy named baddie I want to duplicate. Then I use this code.
duplicateMovieClip(_root.baddie, "baddie"+i, i);
If the i variable is equal to 1 then my new sprite will be named baddie1. Then if I want I can change the properties of that sprite with the following code.
//change x cordinate
_root.baddie1._x= Math.random()*Stage.width;
Last edited by archmage (2008-07-26 02:47:38)
Offline
do u mean like how flash can duplicate
Offline
deatheater wrote:
do u mean like how flash can duplicate
Kinda, it would need to be easier to work with though. I edited my earlier post to show what I mean better.
Offline
so the sprites could duplicate in gameplay?
Offline
deatheater wrote:
so the sprites could duplicate in gameplay?
I suppose you could put it that way. It doesn't have to be a game to have duplicated sprites though.
It really is essential though. Can you think of a way to make a game like desktop tower defense in scratch? I honestly don't think this is possible because you would need tons of sprites (200+ maybe). Firstly, making 200+ sprites would greatly increase the overall file size of the project and secondly, you would probably need to adjust each sprite individually instead of with code (like I demonstrated in my flash example) which would take a ton of time.
Offline
archmage wrote:
deatheater wrote:
so the sprites could duplicate in gameplay?
I suppose you could put it that way. It doesn't have to be a game to have duplicated sprites though.
It really is essential though. Can you think of a way to make a game like desktop tower defense in scratch? I honestly don't think this is possible because you would need tons of sprites (200+ maybe). Firstly, making 200+ sprites would greatly increase the overall file size of the project and secondly, you would probably need to adjust each sprite individually instead of with code (like I demonstrated in my flash example) which would take a ton of time.
and in mutiny how it has all those powder kegs u can place down (I placed over 200 filling up 2 ships then blew it up )
Offline
Lol, this is a great idea. greenfoot has it, and I saw its capabilities. With something like that, games you could be two times bigger with much less lag. It also allows you create great simulations, and I defenitely agree with archmage.
Offline
newareagle wrote:
Lol, this is a great idea. greenfoot has it, and I saw its capabilities. With something like that, games you could be two times bigger with much less lag. It also allows you create great simulations, and I defenitely agree with archmage.
To see sprite duplication at runtime in action go to http://greenfootgallery.org/scenarios/181
Click Run to start the program running. Then click anywhere in the world to see all of the live spiders reproduce.
Offline
dbal wrote:
newareagle wrote:
Lol, this is a great idea. greenfoot has it, and I saw its capabilities. With something like that, games you could be two times bigger with much less lag. It also allows you create great simulations, and I defenitely agree with archmage.
To see sprite duplication at runtime in action go to http://greenfootgallery.org/scenarios/181
Click Run to start the program running. Then click anywhere in the world to see all of the live spiders reproduce.
Yeah ive seen it, and the Scratch Version by Paddle2See. Both are great
Offline
I have often thought about what cool things I could do if I could clone sprites! I'm salivating again...
To play devil's advocate though, there are some serious things to consider when you think about enabling programmatic cloning of sprites. I'll give just one example for now.
Memory issues. It would be ridiculously easy to "crash" Scratch by putting a clone block in a forever loop. Your stage would quickly be overrun by sprites and eventually cause everything to slow down to the point of unusability. A less drastic example is probably more illustrative: if you create some kind of game, you might be confused as to why it works too slowly without realizing that you created hundreds of clones without deleting them (maybe just hiding when they're "destroyed" in the game, rather than actually killing the sprites). This means that Scratchers who use clone are also going to have to worry about memory management (getting rid of things that are no longer used), which can be a difficult concept.
Offline
Yes!
For all the people saying "use the tool", then what if in a game you enter one door and there is one monster. If you enter another door there are two monsters. Sure, you could create three different monsters, then use show/hide scripts. But wouldn't it be easier to create one then duplicate it during gameplay, depending on your condition?
I think it is a great idea.
Offline
I made a post similar to this,called,"A new pen block?",which is basically is about wanting to have a sprite duplication block to perform several functions in scratch,particularly TD(Tower Defense)games and games that require multiple enemies.
Offline
I think its needed, but I would like to see it with dynamic variable creation too. Otherwise, how do you use it for anything useful?
Offline
There could be an extremely laggy way to code it. Have lists for X Y and Direction. And after you duplicate the sprite, it would stamp each duplicate using the X, Y and Direction from the list. It would take a while, though it might work.
Sprite duplication itself is probably an easier way.
The reason I say extremely laggy is because I've done it before.
Last edited by TimeFreeze (2009-08-20 10:41:01)
Offline
Zscratchy wrote:
ANYONE Please notify ZScratchy if in program cloning (duplicating) becomes available.
Thanks
the last topic on this thread is about 3 years old - commenting in these threads is called necroposting and should be avoided
meanwhile the information here is outdated
Offline
There's a high probability that Sprite Duplication (also known as Sprite Cloning) is going to be included in the final feature set of Scratch 2.0 so we shouldn't need this topic any more.
Offline