Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How can I have the coordinates of a clone?
- Laslito777
-
Scratcher
8 posts
How can I have the coordinates of a clone?
Hi i need help to do my game called “Raise a floppa remake” and idk how to have the coordinates of the clone, can you help me please? I have a id system on my proyect
Last edited by Laslito777 (July 11, 2022 22:13:44)
- cIoudyness
-
Scratcher
500+ posts
How can I have the coordinates of a clone?
you already have an id system. absolutely brilliant.
to get the coordinates of a clone, you need the clone to report its coordinates. no other way to get them.
so we can just tell the clone to, forever, pass its x and y position into lists with item (id). basically a clone with id of 1 constantly replaces item 1 of the x list with its x position and item 1 of the y list with its y position. and so on. then you can reference those when you need
to get the coordinates of a clone, you need the clone to report its coordinates. no other way to get them.
so we can just tell the clone to, forever, pass its x and y position into lists with item (id). basically a clone with id of 1 constantly replaces item 1 of the x list with its x position and item 1 of the y list with its y position. and so on. then you can reference those when you need
- abcde1234qwe
-
Scratcher
500+ posts
How can I have the coordinates of a clone?
when I start as a clone(technically @cloudyness's idea)
if <(clone id) = [selected id goes here]> then
add [] to [X v]//For all sprites.
add [] to [Y v]//For all sprites
forever
replace item (1) of [X v] with (x position)
replace item (1) of [Y v] with (y position)
end
end
Last edited by abcde1234qwe (July 11, 2022 22:33:12)
- cIoudyness
-
Scratcher
500+ posts
How can I have the coordinates of a clone?
im an idiot nevermind
carry on
carry on
Last edited by cIoudyness (July 11, 2022 22:45:48)
- Laslito777
-
Scratcher
8 posts
How can I have the coordinates of a clone?
you already have an id system. absolutely brilliant.Okay im gonna try this then
to get the coordinates of a clone, you need the clone to report its coordinates. no other way to get them.
so we can just tell the clone to, forever, pass its x and y position into lists with item (id). basically a clone with id of 1 constantly replaces item 1 of the x list with its x position and item 1 of the y list with its y position. and so on. then you can reference those when you need
Last edited by Laslito777 (July 11, 2022 23:05:36)
- Laslito777
-
Scratcher
8 posts
How can I have the coordinates of a clone?
im an idiot nevermindHEY THAT WORKED!! THANK YOU!
carry on
- Laslito777
-
Scratcher
8 posts
How can I have the coordinates of a clone?
You really help me!when I start as a clone(technically @cloudyness's idea)
if <(clone id) = [selected id goes here]> then
add [] to [X v]//For all sprites.
add [] to [Y v]//For all sprites
forever
replace item (1) of [X v] with (x position)
replace item (1) of [Y v] with (y position)
end
end
- StickMan1087
-
Scratcher
18 posts
How can I have the coordinates of a clone?
when I start as a clone
set [ cloneX] to (x position)
set [ cloneY] to (y position)
- Discussion Forums
- » Help with Scripts
-
» How can I have the coordinates of a clone?