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

#1 2011-02-04 11:17:20

jheffernan
New Scratcher
Registered: 2011-02-04
Posts: 2

Multiple Instances of a Sprite

I was surprised to see when I used the rubber stamp to duplicate a sprite, a totally new sprite was created and not another instance of a sprite with the same scripts, etc.  How do I create a new instance of the same sprite?

Offline

 

#2 2011-02-04 13:19:44

Lord-Sprites
Scratcher
Registered: 2010-01-24
Posts: 500+

Re: Multiple Instances of a Sprite

Do you mean a new costume? Or wait an instance
I'm not sure Scratch can do that


http://ls.gd/tzhttp://ls.gd/aghttp://ls.gd/axhttp://ls.gd/tfhttp://ls.gd/lo

Offline

 

#3 2011-02-04 15:01:03

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: Multiple Instances of a Sprite

It's possible, it's just pretty inconvenient in Scratch and you can only do a limited number of instances.

Lemme find a script to show you, give me a minute.

Last edited by Kileymeister (2011-02-04 15:03:02)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#4 2011-02-04 15:09:59

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Multiple Instances of a Sprite

Get Blocktalk when it is released.


/* No comment */

Offline

 

#5 2011-02-04 15:12:03

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: Multiple Instances of a Sprite

As I said, instance making is difficult.  You have to program each instance into one sprite, there's no button to make one.

This script makes one sprite into two instances that move right and left across the stage separately.  As you can see this is a much bigger and more complex script than if it were one instance.
http://i56.tinypic.com/w20zd1.gif


Note this piece in the script:
http://i54.tinypic.com/xkpvmd.gif
That piece can be copied and pasted multiple times into the forever block to make new instances with the same behavior as the other two, but you must add in an extra starting entry for lists InstanceX, InstanceY, and InstanceDirection (the starting entries are at the top of the script before the forever block).

Last edited by Kileymeister (2011-02-04 15:14:01)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

Board footer