Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to constantly track coordinates of a clone?
- PattyHitsNubs
-
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
-
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
-
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
-
22 posts
How to constantly track coordinates of a clone?
This is a good solution for one clone, if you use ‘When I start as a clone’ instead of ‘when green flag clicked’. This might work.when green flag clicked
forever
set [ X] to (x position)
set [ Y] to (y position)
end
- WFreyTSS
-
22 posts
How to constantly track coordinates of a clone?
This is the best solution for any amount of clones. 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
- electrogame02
-
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
-
100+ posts
How to constantly track coordinates of a clone?
There are no such things as dupe topics in the Help with Scripts section dupe topic
- marcelzietek2006
-
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 questionThere are no such things as dupe topics in the Help with Scripts section dupe topic
- BlueNoodle29
-
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
-
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
-
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
-
100+ posts
How to constantly track coordinates of a clone?
Sorry, my bad There is if he posts it twice in the timespan of 3 minutes with the excact same question
- Discussion Forums
- » Help with Scripts
-
» How to constantly track coordinates of a clone?