Discuss Scratch

emd245
Scratcher
78 posts

Cloning vs. stamping

What is the difference between the blocks {create clone of (myself v) } and {stamp}? It is so confusing. I also don't know whether to use cloning or stamping.

Last edited by emd245 (Aug. 8, 2013 00:35:38)


About me
Registered: (mm/dd/yyyy) 07-07-2013
Scratcher
BEST QUOTE BY FAR: “No wristbands can make one.”
Best project worth checkin' out: //scratch.mit.edu/projects/12152860/
I wish there was an bbcode tag
drmcw
Scratcher
1000+ posts

Cloning vs. stamping

They are very different. Stamp just leaves an image of the sprite on the stage at it's current position however a clone is a bit like duplicating the sprite and so it can be controlled via scripts.

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
turkey3
Scratcher
1000+ posts

Cloning vs. stamping

A clone is an actual character. It can perform actions and do just about everything a sprite can. Clones get deleted when a project starts and stops. Stamps, on the other hand, cannot perform actions. It is simply the image of the sprite displayed on the stage. It is not an actual object, but is just the pen marks that make up the sprite's visual appearance. Imagine a real stamp. You can stamp it, but afterwards it does nothing else but stays there for you to look at.

footsocktoe
Scratcher
1000+ posts

Cloning vs. stamping

Does 10 clones of one sprite have every single ability that 11 different sprites would have? Is there any drawback at all to using clones other than they all look like each other?


SHOOT THE SPACE MONSTERS! ….. A game everyone can play! Bright colors, bonky sounds!
THE 12 BALLS OF CRAZY AL ……. New scrolling adventure game!

fyromaniac1
Scratcher
100+ posts

Cloning vs. stamping

Ya. The stamp is just the costume of the real sprite stamped onto the backround.
The clone is another sprite cloned from the first sprite however, it does not duplicate the sprite on the sprite list.



~fyromaniac1

Check out some of the best games made by me!
drmcw
Scratcher
1000+ posts

Cloning vs. stamping

footsocktoe wrote:

Does 10 clones of one sprite have every single ability that 11 different sprites would have? Is there any drawback at all to using clones other than they all look like each other?

Although you can use any block with a clone not all will work as you may expect. The clone's scripts are started with the when I start as a clone hat block and the clones may also receive broadcasts. What is frustrating is that if you use reporter blocks such as y position, x position, costume# etc then you won't get the values for the clone but the parent sprites values. This limitation can be overcome though by creating a variable for that sprite only, these variable values are then unique for each clone and can be used to store typical reporter values.
Clones means a copy so they get all the parents costumes too so they don't have to look like each other as they can change costume.

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
liam48D
Scratcher
1000+ posts

Cloning vs. stamping

It really depends on what you use clones/stamps for. As far as I know, there is only a limited number of clones. But stamps are unlimited. Stamps are very good for a text creator thing which does not use any clones. Clones are, like turkey3 said, objects with all the same things as the sprite it is a clone of. Speaking of clones, did you know that scientists once cloned a cat in real life?

202e-202e-202e-202e-202e UNI-CODE~~~~~
PERCE-NEIGE
Scratcher
100+ posts

Cloning vs. stamping

drmcw wrote:

footsocktoe wrote:

What is frustrating is that if you use reporter blocks such as y position, x position, costume# etc then you won't get the values for the clone but the parent sprites values.


But you can define the exact position of a clone by adding its coordinate in a list as soon it has been created.

Set a variable to count the clones, you may name it clone_counter by ex.

Script:
NB: I comment with the sign # before the comment.




Set clone_counter to 0
Create list “position x of the clones”
Create list “position y of the clones”
Clone myself—> into clone1, clone2, clone3,… clone10 # I created 10 clones here.
Increase clone_counter by 1 # So, each time I create a clone, the counter increase, I know how many clone are remaining to be create by ex.




When I start as a clone…. #(it is the message that make the clones you created with “clone myself” do an action.
add …. to x
Add x to “position x of the clones” list.
Add y to “position y of the clones” list. # Each one of the clones will write their x and y in the list, as soon as they are called to do something by the “when I start as clone”-script.
Delete this clone # The command to erase clones, you can do erase all in the pen section too.


If you stamp, the stamps can't move, delete itself (unless you delete all the pen actions), do an action, etc.
but stamping is limitless, you have a number limit of clones. (but it's a big limit)
The third solution, would be to create as many sprites as you need items, almost the same than cloning, but each sprites are independant, you can't program common behaviour as in cloning.

scubajerry
Scratcher
1000+ posts

Cloning vs. stamping

I implemented the game Solitiare with 1 sprite, totally using stamping. The 1 spirte would move to where it needed to to either stamp, over stamp, or erase a previous stamp.
http://scratch.mit.edu/projects/2997716/

I recently reimplemented with 1 sprite, totally using cloning. Here, there are 52 clones, each doing what they need to do.
http://scratch.mit.edu/projects/11307926/

Many project can be done either way, but I can tell you the cloning was a lot more intuitive for me.

Powered by DjangoBB

Standard | Mobile