Discuss Scratch

kakaggarwal
Scratcher
1 post

How Can i use a Sprite more than once in the same stage ?

I want to use a sprite more than once in the game i am building. I tried to find some option such as copy sprite or anything else like that, but couldn't. Any help regarding this would be appreciated. This way i would be able to considerably reduce the number of code lines.
777atscratch
Scratcher
100+ posts

How Can i use a Sprite more than once in the same stage ?

Hi!
You could use clones:
when green flag clicked
set [ID v] to [0]
repeat (5)
change [ID v] by (1)

when I start as a clone
forever

if <[ID] = [1]> then
Scripting
end
if <[ID] = [2]> then
Scripting
end
if <[ID] = [3]> then
Scripting
end
if <[ID] = [4]> then
Scripting
end
if <[ID] = [5]> then
Scripting
end
Clones could be clicked, but it needs some more programming.

OR

You could copy sprites by:

1. Select the sprite.
2. Right-click the sprite.
3. A menu will come. Press Duplicate and the sprite is copied!

This is my scripting skills.

Last edited by 777atscratch (Jan. 6, 2014 06:38:34)

scubajerry
Scratcher
1000+ posts

How Can i use a Sprite more than once in the same stage ?

Fixed, as I think you left out the most important line. I also changed it slightly to make ID work a little better.

777atscratch wrote:

Hi!
You could use clones:
when green flag clicked
set [ID v] to [0] //ID need to be a FOR THIS SPRITE ONLY variable
repeat (5)
change [ID v] by (1)
create clone of [myself v]
end
set [ID v] to (0) //So you tell the original from a clone. It comes in handy if responding to broadcasts.

when I start as a clone
forever

if <[ID] = [1]> then
Scripting
end
if <[ID] = [2]> then
Scripting
end
if <[ID] = [3]> then
Scripting
end
if <[myID] = [4]> then
Scripting
end
if <[ID] = [5]> then
Scripting
end
Clones could be clicked, but it needs some more programming.

OR

You could copy sprites by:

1. Select the sprite.
2. Right-click the sprite.
3. A menu will come. Press Duplicate and the sprite is copied!

This is my scripting skills.

Last edited by scubajerry (Jan. 6, 2014 08:44:33)

Powered by DjangoBB