Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
If statements
Old
lancer
Guest
 
Status:
Posts: n/a
Question If statements - 05-05-2010, 07:18 PM

I am trying to make a penguin follow this sequence:
Circle resizes world random number with min: 0.2 and max: 2.0
Penguin turns toward circle
~Here starts the problem~
If (the distance to the circle is less than 2 meters)
{
the penguin walks to the circle
If (the penguin is smaller than the circle)
{
The penguin walks to the circle and jumps in
}
else
{
The penguin says, "It's too small."
}
}
else
{
The penguin says, "It's too far."
}

But I don't how to make the program say it in the method. Anyone know or can suggest what to do?
Attached Files
File Type: a2w penguinwithif&random.a2w (408.3 KB, 10 views)
   
Reply With Quote
Old
bedlam
Guest
 
Status:
Posts: n/a
Default 09-30-2010, 11:07 PM

The first change I would make is to your first if statement:

should be:
If penguin is within five meters of circle

Then the nested if statement would be:

If penguin is smaller than circle.

Inside of your if statements, you can just drag the penguin says icon in there and it will say it's thing at the appropriate time.

The random sized hole is a clever idea. It expanded my horizons.

See the attached improved version:
Attached Files
File Type: a2w penguinwithif&randomImproved.a2w (411.3 KB, 13 views)
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.