Discuss Scratch

DragonFire973
Scratcher
31 posts

How to apply different coordinates to each clone.

So, I have something where I need a sprite to clone, and then give its clone a new coordinate. How would I do this, and is it even possible?
awesome-llama
Scratcher
1000+ posts

How to apply different coordinates to each clone.

The answer probably is local variables. They allow clones to have their own, unique copy of the variable, allowing it to be different for each clone.




↑↑ Click any of the images for an awesome project! ↑↑
◃◁ Click this for my YT channel! ▷▹




My 500th post: https://scratch.mit.edu/discuss/topic/189237/?page=1#post-1861516
My 1000th post: https://scratch.mit.edu/discuss/topic/216809/?page=1#post-2193087
My 1500th post: https://scratch.mit.edu/discuss/topic/234381/?page=1#post-2388018
YmFja3VwLXNpZ2d5LWlk Google this to see my posts.
Starstriker3000
Scratcher
1000+ posts

How to apply different coordinates to each clone.

Use these scripts (make sure you make identical costumes, and the number of costumes should equal the number of sprites you want):

switch costume to [1 v] // apply this to the Sprite you're cloning
create clone of [myself v]
switch costume to [2 v]
create clone of [myself v]
switch costume to [3 v]
create clone of [myself v]
...

when I start as a clone
... // this applies to all clones
if <(costume [number v] :: looks) = [1]> then
... // this applies only to the clone made with costume 1
end
if <(costume [number v] :: looks) = [2]> then
... // this applies only to the clone made with costume 2
end
if <(costume [number v] :: looks) = [3]> then
... // this applies only to the clone made with costume 3
end



This is my official 500th post!
super_epic_games
Scratcher
43 posts

How to apply different coordinates to each clone.

what i found works is if when you clone them, turn them one degree each time. since scratch only allows 300 clones at once, and there's 360 degrees in a circle, you will not run into any problems. also, when you create it, you are going to have to have two lists: 1 for all the angles and the other one for the variables. here's some code for it:
when green flag clicked
repeat (...)
create clone of [myself v]
add (direction) to [ANGLES v]
add [YOUR VARIABLE] to [varibles v]
end

g'day from Australia
the outback country
DragonFire973
Scratcher
31 posts

How to apply different coordinates to each clone.

That is so smart!! Thank you!!
DragonFire973
Scratcher
31 posts

How to apply different coordinates to each clone.

Also, do you know how to sense what another sprite's costume number is?
deck26
Scratcher
1000+ posts

How to apply different coordinates to each clone.

DragonFire973 wrote:

Also, do you know how to sense what another sprite's costume number is?
For a sprite just use the sensing block

([ v] of [Sprite1 v])
DragonFire973
Scratcher
31 posts

How to apply different coordinates to each clone.

K, thanks.

Powered by DjangoBB

Standard | Mobile