- Construct a scene
- Demonstrate random movement
- Demonstrate Boolean functions
- Demonstrate the IF/ELSE command
To Do List
- Read chapter 6
- Watch lecture video
- Watch assignment video
- Complete assignment
- Complete chapter 6 quiz
- Chapter 6 – Functions and IF/ELSE
Have a penguin randomly move around and an Eskimo trying to catch the penguin. (Use an infinite loop).
Total points: 100
Add these objects:
- Penguin – Animals (5 points)
- Eskimo – People (5 points)
Create these methods:
- Penguin – Create a method called “Random Move”(5 points), randomly turn the penguin to the left or right ¼ turn(10 points), randomly JUMP 20% of the time(10 points), randomly flap the wings 20% of the time (5 points)(using the built-in wing flap method)(5 points), use the built-in walk method (1 time)(5 points), and move the penguin 1 meter forward(5 points). Use IF/ELSE and the World function (under Random) called Choose True Probability of True to make the penguin turn, jump, and flap wings. You will need a separate IF/ELSE for turn, jump, and flap wings.
- Eskimo – Create a method called “Move Eskimo”(5 points), turn Eskimo toward Penguin(5 points) and move the Eskimo 1 meter forward(5 points). Use iIF/ELSE to determine if the Eskimo is within 1 meters of the Penguin (10 points). If so, have the Eskimo say “I’ve caught the penguin”.
- Add other penguins or objects that wander around (10 points).
- Add other scenery objects (10 points).
- Comment your program and all methods (10 points).
Login to Blackboard (or Epic for Academic Partnership students) and take the Chapter 6 quiz.