email me at borlaj@portlandschools.org

Loading
notes previous (10/<10) submit the dump links  
 

HW7

 

1. Zombie
Create a world w/ a zombie and an open grave (black square on the ground). In a scene from a scary movie, the zombie walks forward toward the grave and falls in. In this animation, every time the user presses the space bar, the zombie should walk forward.

Create a boolean function named isAboveGrave that returns true if the zombie is within one-half meter of the grave. When the function returns true, make the zombie fall in.

Requirements: Function isAboveGrave that will return true or false


2. Create a world with a lichenZenspider (Fantasy/Fairies) between two trees (Nature). Animate the lichenZenspider flying back and forth between the two trees. Make the world interactive so that lichenZenspider flies forward a short distance each time the user presses the enter key. LichenZenspider should move forward until she reaches a tree, then turn around to fly back toward the other tree. When she gets to the second tree, she should turn around to fly back toward the first tree. Be sure to avoid lichen­Zenspider's colliding with a tree.

Requirements: Function timeToTurn that will return true or false


3. Lightbulb
Create a world with a lightbulb (Lights) and a method turn On Off that turns the lightbulb on/off depending on whether it is already on/off. Write a Boolean function isLightOn that returns true if the light bulb is on and false if it is off. When clicked, the lightbulb should turn on/off.

Requirements: Function isLightOn that will return true or false

When the lightbulb is on, its emissive color property has a value of yellow. When the lightbulb is off, its emissive color is black.

 

4. Spanish Vocabulary
A common exercise in teaching someone a new language is to show the person familiar objects and ask for the word for that object. In this exercise, you are to write a simple vocabulary builder to help someone learn the Spanish word for cat. The scene below shows a cat sitting on the grass and three Spanish words (3D text) displayed in front of the cat. The user is expected to click on the correct Spanish word for cat. A click on any other object will not work. Write a function (isGato) that returns true if the word (a 3D text object) selected is "gato," and false otherwise. The function will use one parameter (objectClicked) to send in the 3D text word clicked by the user. If the user clicks on "gato," the cat will say "Si, si!" Otherwise, the cat should turn its head left and right (indicating that the choice was incorrect).

Requirements: Function isGato (taking in a parameter objectClicked) that will return true or false