Discuss Scratch

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)
marcelzietek2006
Scratcher
500+ posts

How to constantly track coordinates of a clone?

dupe topic
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?

Skywarslord wrote:

This might work.
when green flag clicked
forever
set [ X] to (x position)
set [ Y] to (y position)
end
This is a good solution for one clone, if you use ‘When I start as a clone’ instead of ‘when green flag clicked’.
WFreyTSS
Scratcher
22 posts

How to constantly track coordinates of a clone?

electrogame02 wrote:

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
This is the best solution for any amount of clones.
electrogame02
Scratcher
500+ posts

How to constantly track coordinates of a clone?

electrogame02 wrote:

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?

marcelzietek2006 wrote:

dupe topic
There 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?

qucchia wrote:

marcelzietek2006 wrote:

dupe topic
There are no such things as dupe topics in the Help with Scripts section
There is if he posts it twice in the timespan of 3 minutes with the excact same question
BlueNoodle29
Scratcher
100+ posts

How to constantly track coordinates of a clone?

Skywarslord wrote:

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?

BlueNoodle29 wrote:

Skywarslord wrote:

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?







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…
BlueNoodle29
Scratcher
100+ posts

How to constantly track coordinates of a clone?

marcelzietek2006 wrote:

BlueNoodle29 wrote:



those would have to be local variables, right?







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…

ok thanks
qucchia
Scratcher
100+ posts

How to constantly track coordinates of a clone?

marcelzietek2006 wrote:

There is if he posts it twice in the timespan of 3 minutes with the excact same question
Sorry, my bad

Powered by DjangoBB