Discuss Scratch

ChessDad
New to Scratch
3 posts

Working with multiple sprites

Hello,

Is there a way to program a group of sprites at one time rather than have to do it individually? I have 8 sprites I want to move towards some trees.

Thanks for your help.

Chess Dad.
gigapouch
Scratcher
1000+ posts

Working with multiple sprites

Try making 2 global variables for the first sprite that store the x and y position. Use this script for the first sprite:

forever
set [globalX v] to (x position)
set [globalY v] to (y position)
end

And then set the other sprites' x and y position to a similar position as the first sprite, but not exactly the same. For example:

Sprite 2:

forever
set x to ((globalX) + (5))
set y to (globalY)
end

Sprite 3:

forever
set x to ((global X) + (7))
set y to (globalY)
end

… and so on.

Last edited by gigapouch (June 10, 2014 23:16:29)


I have a Steam account. If you have one too, feel free to add me to your friends list.
Also check out my YouTube channel if you like the outdoors, Minecraft, cars, roller coasters, etc.
ChessDad
New to Scratch
3 posts

Working with multiple sprites

Thank you! Thank you! Thank you!

Powered by DjangoBB

Standard | Mobile