This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-07-26 01:39:22

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Sprite Duplication - Why not?

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)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#2 2008-07-26 02:28:52

Colkadome
Scratcher
Registered: 2008-03-01
Posts: 54

Re: Sprite Duplication - Why not?

There IS sprite duplication you know. Just hold down ctrl or alt and click a sprite in the list below the stage.

Offline

 

#3 2008-07-26 02:32:11

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: Sprite Duplication - Why not?

I think he means during gameplay

Offline

 

#4 2008-07-26 02:38:34

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Sprite Duplication - Why not?

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)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#5 2008-07-26 02:41:10

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: Sprite Duplication - Why not?

do u mean like how flash can duplicate

Offline

 

#6 2008-07-26 02:46:26

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Sprite Duplication - Why not?

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.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#7 2008-07-26 03:04:34

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: Sprite Duplication - Why not?

so the sprites could duplicate in gameplay?

Offline

 

#8 2008-07-26 03:17:32

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Sprite Duplication - Why not?

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.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#9 2008-07-26 03:29:20

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: Sprite Duplication - Why not?

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  smile  )

Offline

 

#10 2008-07-26 12:30:51

newareagle
Scratcher
Registered: 2008-06-10
Posts: 100+

Re: Sprite Duplication - Why not?

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.


My Guitar Hero Game.
8/9 Projects on the Front Page at Once!

Offline

 

#11 2008-07-28 00:07:08

dbal
Scratcher
Registered: 2007-07-19
Posts: 100+

Re: Sprite Duplication - Why not?

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.


Dick Baldwin - Don't get stuck scratching. When you master Scratch, move on up to more serious programming languages. Free online programming tutorials:
Scratch - Alice - Java - C# - C++ - JavaScript - XML - Python - DSP

Offline

 

#12 2008-07-28 00:56:58

newareagle
Scratcher
Registered: 2008-06-10
Posts: 100+

Re: Sprite Duplication - Why not?

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  tongue


My Guitar Hero Game.
8/9 Projects on the Front Page at Once!

Offline

 

#13 2008-07-28 07:29:55

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Sprite Duplication - Why not?

Yeah, in my early days I was thinking about making a frogger game, but the lack of sprite duplication sort of stopped me.

Offline

 

#14 2008-07-28 10:57:37

inuwali
Scratcher
Registered: 2007-10-01
Posts: 13

Re: Sprite Duplication - Why not?

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

 

#15 2008-08-04 20:07:47

relyt12101
Scratcher
Registered: 2007-05-19
Posts: 500+

Re: Sprite Duplication - Why not?

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.


http://img392.imageshack.us/img392/2860/pspbanneregg089deiy0.png

Offline

 

#16 2009-08-19 19:32:27

Brass45
Scratcher
Registered: 2009-05-03
Posts: 500+

Re: Sprite Duplication - Why not?

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.


http://img412.imageshack.us/img412/4593/ubd1591.png<--Our website(click)
http://static.zooomr.com/images/8884671_b196719ffa_o.png<--If this image looks interesting,then click it to see an exclusive sneak peak of Evil Strings newest game:DarkLight

Offline

 

#17 2009-08-19 21:34:59

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: Sprite Duplication - Why not?

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

 

#18 2009-08-20 10:40:20

TimeFreeze
Scratcher
Registered: 2008-08-11
Posts: 500+

Re: Sprite Duplication - Why not?

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)


There are 10 types of people in this world: Those who understand binary, and those who don't. --[insert unrelated transition]-- GRANDILOQUENCE FTW!

Offline

 

#19 2012-06-21 14:02:55

Zscratchy
Scratcher
Registered: 2012-03-10
Posts: 3

Re: Sprite Duplication - Why not?

ANYONE Please notify ZScratchy if in program cloning (duplicating) becomes available.

Thanks

Offline

 

#20 2012-06-21 14:15:13

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Sprite Duplication - Why not?

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

 

#21 2012-06-21 14:51:32

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Sprite Duplication - Why not?

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.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

Board footer