This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-06-07 19:31:41

littlecat1111
Scratcher
Registered: 2012-05-28
Posts: 36

How to make sprites (people) randomly walk around

I want to make a game that is simulating middle school, and I want people to randomly walk around and "mingle" if you will, sometimes go off the sreen and come back. How!?

Offline

 

#2 2012-06-07 19:36:22

littlecat1111
Scratcher
Registered: 2012-05-28
Posts: 36

Re: How to make sprites (people) randomly walk around

please help me!!! answer!!

Offline

 

#3 2012-06-07 19:40:49

littlecat1111
Scratcher
Registered: 2012-05-28
Posts: 36

Re: How to make sprites (people) randomly walk around

this question may shock you, WHY are the views rising, and NOT THE REPLIES!

Offline

 

#4 2012-06-07 19:52:49

littlecat1111
Scratcher
Registered: 2012-05-28
Posts: 36

Re: How to make sprites (people) randomly walk around

sad

Offline

 

#5 2012-06-07 19:55:19

Randomness_Player
Scratcher
Registered: 2012-06-06
Posts: 20

Re: How to make sprites (people) randomly walk around

While your walking...

when flag clicked
change y by (pick random (1) to (5)
You could use color sensing, if it goes off the screen it will go back to the main place

when flag clicked
forever
if <touching color [color of ground]?>
go to x: (0) y: (0)
end
end

Offline

 

#6 2012-06-07 20:02:34

PhirripSyrrip
Scratcher
Registered: 2012-02-11
Posts: 100+

Re: How to make sprites (people) randomly walk around

It's kinda hard, try this (it'll probably be glitchy but I'll try my best  smile

when gf clicked
show
go to x: (pick random [-240] to [240]) y: (pick random [-180] to [180])
forever
turn cw (pick random [-90] to [90]) degrees
repeat until <touching [edge v] ?>
move (10) steps
if on edge, bounce
end
hide
wait (pick random [0] to [10]) secs
show
You will need to create multiple sprites such as these. In scratch 2.0 it will be easier as you can just clone 1 sprite. This script may not be (and probably isn't) perfect do a bit of tweaking may be needed  smile

Last edited by PhirripSyrrip (2012-06-07 20:07:02)


http://i46.tinypic.com/ao03lk.png

Offline

 

#7 2012-06-07 20:13:27

Randomness_Player
Scratcher
Registered: 2012-06-06
Posts: 20

Re: How to make sprites (people) randomly walk around

Randomness_Player wrote:

While your walking...

when flag clicked
change y by [5] // You could replace 5 into another number or just use the pick random block
You could use color sensing, if it goes off the screen it will go back to the main place

when flag clicked
forever
if <touching color [color of ground]?>
go to x: (0) y: (0)
end
end

Fixed my scripts...

also did I made a mistake on double posting?

Offline

 

#8 2012-06-07 20:17:36

littlecat1111
Scratcher
Registered: 2012-05-28
Posts: 36

Re: How to make sprites (people) randomly walk around

PhirripSyrrip wrote:

It's kinda hard, try this (it'll probably be glitchy but I'll try my best  smile

when gf clicked
show
go to x: (pick random [-240] to [240]) y: (pick random [-180] to [180])
forever
turn cw (pick random [-90] to [90]) degrees
repeat until <touching [edge v] ?>
move (10) steps
if on edge, bounce
end
hide
wait (pick random [0] to [10]) secs
show
You will need to create multiple sprites such as these. In scratch 2.0 it will be easier as you can just clone 1 sprite. This script may not be (and probably isn't) perfect do a bit of tweaking may be needed  smile

Thank you VERY much this was helpful  smile

Offline

 

#9 2012-06-07 20:32:30

PhirripSyrrip
Scratcher
Registered: 2012-02-11
Posts: 100+

Re: How to make sprites (people) randomly walk around

You're welcome  smile


http://i46.tinypic.com/ao03lk.png

Offline

 

#10 2012-06-08 03:36:17

JH1010
Scratcher
Registered: 2012-05-31
Posts: 1000+

Re: How to make sprites (people) randomly walk around

Try this:

forever
glide (1) secs to x <pick random between (-200) to (200)> y <pick random between (-150) to (150)
end

Offline

 

Board footer