Discuss Scratch

crazydoglady31
Scratcher
15 posts

How to I make a sprite glide around randomly?

I want to make it where a bunch of sprites are just floating around randomly. (like in the game slither) How can I make that script?
ELevell
Scratcher
100+ posts

How to I make a sprite glide around randomly?

Try something like this:

foreverglide1secstox:pickrandom-240to240y:pickrandom180to-180

Let me know if this helps!
duckboycool
Scratcher
1000+ posts

How to I make a sprite glide around randomly?

What do you mean by floating around randomly. What I'm thinking of does not happen in slither.io.

If that's what you mean, you should also have a pick random .5 to 3 in the secs to make it more random.

Last edited by duckboycool (Jan. 27, 2017 01:48:38)

DominoDragon1
Scratcher
1000+ posts

How to I make a sprite glide around randomly?

This is the same thing, but the sprite will always move the same speed, I think.

foreversetxtopickrandom-240to240setytopickrandom-180to180glideSomething*sqrtofsquareofx-y+squareofxposition-ypositionsecstox:xy:y
Last part was cut off, it should be:
y: y(the variable)
The something should be a number you play around with to get the speed you want.
Hope I helped!

Last edited by DominoDragon1 (Jan. 27, 2017 01:58:53)

crazydoglady31
Scratcher
15 posts

How to I make a sprite glide around randomly?

Thank you! did it
ELevell
Scratcher
100+ posts

How to I make a sprite glide around randomly?

crazydoglady31 wrote:

Thank you! did it

Nice work! Which script did you use?
crazydoglady31
Scratcher
15 posts

How to I make a sprite glide around randomly?


whenclickedforevergotox:pickrandomto10y:pickrandomto10

Last edited by crazydoglady31 (Jan. 27, 2017 18:26:40)

DominoDragon1
Scratcher
1000+ posts

How to I make a sprite glide around randomly?

crazydoglady31 wrote:

whenclickedforevergotox:pickrandomto10y:pickrandomto10
This would make the sprite move all over the place randomly, not gliding there.
crazydoglady31
Scratcher
15 posts

How to I make a sprite glide around randomly?

i dont know for sure how to fix that but its ok
Bentton
Scratcher
53 posts

How to I make a sprite glide around randomly?

If you want it to bounce around, use this script:
whenclickedpointindirectionpickrandom-90to270gotox:0y:0setrotationstyledon't rotateforevermove10stepsifonedge,bounce
Otherwise, If you want it to glide around do what ELevell said:

ELevell wrote:

Try something like this:

foreverglide1secstox:pickrandom-240to240y:pickrandom180to-180

Let me know if this helps!
KoenigseggRS
Scratcher
2 posts

How to I make a sprite glide around randomly?

That helped
KoenigseggRS
Scratcher
2 posts

How to I make a sprite glide around randomly?

Bentton wrote:

If you want it to bounce around, use this script:
whenclickedpointindirectionpickrandom-90to270gotox:0y:0setrotationstyledon't rotateforevermove10stepsifonedge,bounce
Otherwise, If you want it to glide around do what ELevell said:

ELevell wrote:

Try something like this:

foreverglide1secstox:pickrandom-240to240y:pickrandom180to-180

Let me know if this helps!
That helped.
C4-4life
Scratcher
3 posts

How to I make a sprite glide around randomly?

but what if your sprite starts at 0,0
AmberPandax1212
New Scratcher
1 post

How to I make a sprite glide around randomly?

well i think that it depend on who u are a if u are controlly a f or m yeh school is boring thats why im here
scratchbuilder247
Scratcher
48 posts

How to I make a sprite glide around randomly?

It is very easy

SuperSean12
Scratcher
500+ posts

How to I make a sprite glide around randomly?

(deleted because i didnt know this was an old topic)

Last edited by SuperSean12 (Aug. 17, 2020 10:06:09)

Fadelplayz
Scratcher
18 posts

How to I make a sprite glide around randomly?

Guys, I think we are necroposting around here
CodeCorps
Scratcher
22 posts

How to I make a sprite glide around randomly?

glide1secstorandom position

Last edited by CodeCorps (Dec. 23, 2020 20:05:26)

Powered by DjangoBB