Zebra0.com

aliceActive Learning: A Soccer Game

Active Learning: A Soccer Game

Create an animation in Alice that does the following:
Two boys are practicing their soccer in the park. Repeat the following 3 times using procedures and functions where appropriate:

  1. Boy1 makes kicking motion and says “1” (the first time)
  2. Ball is moved a random distance between half the distance between the two boys and the full distance between the boys.
  3. Boy2 moves to the ball and makes a kicking motion and says “2” (the first time)
  4. Ball is moved a random distance between half the distance between the two boys and the entire distance between the two boys.
  5. The boys will say back and forth, "1", "2", "3", "4" . . . until they reach "6".
  6. If at the end, the boys are within 1 meter of each other, they both say "We won!" Otherwise they both say "We need more practice!" This requires an if/else block!

Specifications:

Suggestions: This is a longer program than previous ones.

public void myFirstMethod() {
//Programmer : _____
//Project : Soccer Game
Integer counter = 0;
/*do in order*/
{
  while ( counter < 6 ) {
      counter = counter+1;
      this.player1.say( ""+counter );
      counter = counter+1;
      this.player2.say( ""+counter );
  }
}

soccermatch.pdf

 

Active Learning Index