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

#1 2007-04-09 16:53:37

misterlawrence
Scratcher
Registered: 2007-04-09
Posts: 6

Help me "Chomp" please

I have created a short little program called "Chomp 1": http://scratch.mit.edu/projects/misterlawrence/1242

When the "Little Fishes" sense the "Big Fish" then the score should go up by 1, the little fish should say "Meow" and the Little Fish should disappear.

For some reason, the little fish do not seem to sense the big fish, and so they never get "eaten".

Can someone please take a look at the code and let me know why this may not be working as I designed it to?

Offline

 

#2 2007-04-11 09:20:05

tjolson
Scratcher
Registered: 2007-03-07
Posts: 8

Re: Help me "Chomp" please

I just took a look at your code. On the Little Fish script you have the "If...Else" statement as the outer control structure, with a "forever" loop inside the "If". Once the "forever" loop is entered, you just turn and glide, but never check if the Little Fish is touching the Big Fish.

My suggestion is to make the "forever" loop the outer control structure, and leave the "turn and glide" blocks in the "If" block, moving the "forever" to the outside.

Does this help?

Tom

Offline

 

#3 2008-09-26 20:47:56

erind616
Scratcher
Registered: 2007-10-19
Posts: 51

Re: Help me "Chomp" please

Let me put that in blocks for you.

Yours:
<if>
<forever>
<end>
<else>
<end>

What he suggested (I think):
<forever>
<if>
<else>
<end>
<end>

Does that make more sense????


What you lookin' at??? I thought so!!!

Offline

 

#4 2008-09-26 20:49:49

erind616
Scratcher
Registered: 2007-10-19
Posts: 51

Re: Help me "Chomp" please

Woah... that turned out bad...  big_smile


What you lookin' at??? I thought so!!!

Offline

 

Board footer