Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Help with a return scrpit
- banbooman
-
Scratcher
10 posts
Help with a return scrpit
Okay lets say I want a sprite to return to X:0 Y:0 but unlike the guide script I want the sprite to go there at a set speed and not a time based speed like “go to_ in 1 second” I want something like “go to__ at move 3X” or something any ideas yall?
- GamingCat12345
-
Scratcher
500+ posts
Help with a return scrpit
Just use a repeat loop, point towards your destination and move X steps.
BTW what's a s-c-r-P-I-t? (I know you mean “script” but ye, had to point that out lol)
point in direction ([atan v] of (((x) - (x position)) / ((y) - (y position)))
if <((y) - (y position)) < (0)> then
turn cw (180) degrees
end
repeat until <<(round (x position)) = (x)> and <(round (y position)) = (y)>>
move (s) steps
end
BTW what's a s-c-r-P-I-t? (I know you mean “script” but ye, had to point that out lol)
Last edited by GamingCat12345 (Feb. 15, 2025 00:53:08)
- Paddle2See
-
Scratch Team
1000+ posts
Help with a return scrpit
It looks like this is a duplicate topic of this one over here so I'll close it to keep the conversation all in one place.
Please use the existing topic in the link above.
Please use the existing topic in the link above.
- Discussion Forums
- » Help with Scripts
-
» Help with a return scrpit