Discuss Scratch

Olinguitogirl
Scratcher
6 posts

How do you make a sprite move around randomly?

I found a studio with cool projects with sprites that move around randomly. How can I do this?!!!
AgentCNF
Scratcher
100+ posts

How do you make a sprite move around randomly?

It couldn't be done without this block

(pick random () to ())

Last edited by AgentCNF (Dec. 14, 2014 04:48:14)


Play my latest game, Pixel Town 2.
Tobo2020
Scratcher
20 posts

How do you make a sprite move around randomly?

It's very simple:
when green flag clicked
forever

go to x: (pick random (-240) to (240)) y: (pick random (-180) to (180))
wait [put number here] secs
end
And done! Easy, uh?
GeneralMoustache
Scratcher
14 posts

How do you make a sprite move around randomly?

when green flag clicked
forever
glide (1) secs to x: (pick random (-240) to (240)) y: (pick random (-240) to (240))
end
The_Best_Creator
Scratcher
88 posts

How do you make a sprite move around randomly?

I agree with everything they say.

-The_Best_Creator
Cyoce
Scratcher
500+ posts

How do you make a sprite move around randomly?

when gf clicked
forever
repeat until <(pick random (1) to (100)) = (probability of changing directions % :: grey)>
move (speed :: grey) steps
end
point in direction (pick random (1) to (360))
end
FrankieJrJr
Scratcher
100+ posts

How do you make a sprite move around randomly?

when green flag clicked
forever
if <(pick random (1) to (30)) = [18]> then

change x by (5)
FrankieJrJr
Scratcher
100+ posts

How do you make a sprite move around randomly?

Then to make the charater move left just make the X chnage by -5. You can also make the character point in the direction that the move.
Olinguitogirl
Scratcher
6 posts

How do you make a sprite move around randomly?

Thanks! That really helped
hawk9510
Scratcher
64 posts

How do you make a sprite move around randomly?

Easy peasy.

when green flag clicked
forever

go to x: (pick random (1) to (100)) y: (pick random (1) to (100))
end
elliejorja
New to Scratch
1 post

How do you make a sprite move around randomly?

I have absolutely no idea at all, that is why I want to know myself.
rajauppal
Scratcher
17 posts

How do you make a sprite move around randomly?

here is an easy code
when green flag clicked
forever

glide (1) secs to x: ((pick random (-240) to (240)) y: ((pick random (-240) to (240))
end


hope this helps

LOL
deck26
Scratcher
1000+ posts

How do you make a sprite move around randomly?

rajauppal wrote:

here is an easy code
when green flag clicked
forever

glide (1) secs to x: ((pick random (-240) to (240)) y: ((pick random (-240) to (240))
end


hope this helps
I think this topic has been dealt with so should be treated as closed. Also, you needed to use -180 to 180 for y!
Coolbp5
Scratcher
5 posts

How do you make a sprite move around randomly?

https://scratch.mit.edu/projects/86605133/

I made a tutorial on moving randomly with actions!
xMCLegendx
Scratcher
2 posts

How do you make a sprite move around randomly?

Jayfeather020
Scratcher
1 post

How do you make a sprite move around randomly?

I like blocks
when green flag clicked
say [mwhahahaha] for (2) secs

Last edited by Jayfeather020 (Jan. 5, 2016 23:15:46)

azure1025
Scratcher
30 posts

How do you make a sprite move around randomly?

for a controlled one, do

when green flag clicked
forever

glide (2) secs to x: ((pick random (-240) to (240))) y: (pick random (-240) to (240))
end
for a crazy one do

when green flag clicked
forever

move (pick random (5) to (25)) steps
point in direction ((pick random (180) to (-180)) v)
end
I dunno why but the
when green flag clicked
isn't connected to the
forever

end

Last edited by azure1025 (Jan. 6, 2016 09:36:55)

azure1025
Scratcher
30 posts

How do you make a sprite move around randomly?


Last edited by azure1025 (Jan. 6, 2016 09:34:49)

RX-78-02
Scratcher
2 posts

How do you make a sprite move around randomly?

Hi guys! I just made a game with a random sprite. If you guys could leave a comment on my new game and help me with the random movements and bugs, it would be really great. The game is called =https://scratch.mit.edu/projects/96221896/#player]Gundam, Zaft Reborn
TheGuardian5
Scratcher
2 posts

How do you make a sprite move around randomly?

move () steps
turn ccw () degrees
turn cw () degrees
point in direction ( v)
point towards [ v]
go to x: () y: (0)

when I start as a clone
stop [ v]
repeat until <>
wait until <>
if <> then
forever

repeat ()
wait () secs

end

end


end


end

Powered by DjangoBB