Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to constantly track coordinates of a clone?
- PattyHitsNubs
-
Scratcher
2 posts
How to constantly track coordinates of a clone?
Hey, I'm currently trying to find out how to constantly find coordinates for a clone of an object. I've seen multiple guides to find the coordinates at one point, but I cannot find this. Any solutions? Thanks!(if necessary I can share my game for you all to look at)
- Skywarslord
-
Scratcher
100+ posts
How to constantly track coordinates of a clone?
This might work.
when green flag clicked
forever
set [ X] to (x position)
set [ Y] to (y position)
end
- electrogame02
-
Scratcher
500+ posts
How to constantly track coordinates of a clone?
Easy peasy, here we go:
when I start as a clone
set [My id v] to (Clone index)
forever
replace item (My id) of [x v] with (x position)
replace item (My id) of [y v] with (y position)
end
- WFreyTSS
-
Scratcher
22 posts
How to constantly track coordinates of a clone?
This might work.This is a good solution for one clone, if you use ‘When I start as a clone’ instead of ‘when green flag clicked’.when green flag clicked
forever
set [ X] to (x position)
set [ Y] to (y position)
end
- WFreyTSS
-
Scratcher
22 posts
How to constantly track coordinates of a clone?
Easy peasy, here we go:This is the best solution for any amount of clones.when I start as a clone
set [My id v] to (Clone index)
forever
replace item (My id) of [x v] with (x position)
replace item (My id) of [y v] with (y position)
end
- electrogame02
-
Scratcher
500+ posts
How to constantly track coordinates of a clone?
Easy peasy, here we go:when I start as a clone
set [My id v] to (Clone index)
forever
replace item (My id) of [x v] with (x position)
replace item (My id) of [y v] with (y position)
end
Also remember: “My id” variable must be “for this sprite only” variable, so the clones can have personal data, in this case their corresponding number.
- qucchia
-
Scratcher
100+ posts
How to constantly track coordinates of a clone?
dupe topicThere are no such things as dupe topics in the Help with Scripts section
- marcelzietek2006
-
Scratcher
500+ posts
How to constantly track coordinates of a clone?
There is if he posts it twice in the timespan of 3 minutes with the excact same questiondupe topicThere are no such things as dupe topics in the Help with Scripts section
- BlueNoodle29
-
Scratcher
100+ posts
How to constantly track coordinates of a clone?
This might work.when green flag clicked
forever
set [ X] to (x position)
set [ Y] to (y position)
end
those would have to be local variables, right?
- marcelzietek2006
-
Scratcher
500+ posts
How to constantly track coordinates of a clone?
If they would be local variables, no one except for the clones could acces them, so no they should be global variables or better just in a list…This might work.when green flag clicked
forever
set [ X] to (x position)
set [ Y] to (y position)
end
those would have to be local variables, right?
- BlueNoodle29
-
Scratcher
100+ posts
How to constantly track coordinates of a clone?
If they would be local variables, no one except for the clones could acces them, so no they should be global variables or better just in a list…
those would have to be local variables, right?
ok thanks
- qucchia
-
Scratcher
100+ posts
How to constantly track coordinates of a clone?
There is if he posts it twice in the timespan of 3 minutes with the excact same questionSorry, my bad
- Discussion Forums
- » Help with Scripts
-
» How to constantly track coordinates of a clone?






