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

#1 2011-06-22 22:46:22

thelibraryguy
New Scratcher
Registered: 2011-05-07
Posts: 2

Program sprites to run away

If I was making a game in which the player controls a shark and tries to catch fish, how could I program the fish to move away from the shark when the shark gets close? Any suggestions would be greatly appreciated.

Offline

 

#2 2011-06-22 22:54:55

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: Program sprites to run away

I think the easiest thing to do is add in this script:
http://i56.tinypic.com/9l8x0o.gif

Though I don't know how you've programmed the fish, so I can't be sure.  Also you can edit that 100 to change how close the shark can get before the fish swims away.

Last edited by Kileymeister (2011-06-22 22:55:35)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#3 2011-06-22 23:22:49

thelibraryguy
New Scratcher
Registered: 2011-05-07
Posts: 2

Re: Program sprites to run away

Thanks, Kileymeister - I'll give it a try.

Offline

 

Board footer