Download JF_2_4_ProjectSolution Rotation and Randomization 6p PDF

TitleJF_2_4_ProjectSolution Rotation and Randomization 6p
TagsSoftware Java Programming Language Computer Engineering Areas Of Computer Science Trademark
File Size1.2 MB
Total Pages6
Document Text Contents
Page 1

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trade-
marks of their respective owners.





Java Fundamentals
2-4: Rotation and Randomization
Project Solution

This project will progress with you throughout the course. After each lesson there will be more to add until it
builds into a complete animation that you can upload to YouTube or export as a local animation file.



Instructions:


1. Open Alice 3 on your computer.


2. Either using the My Projects tab or the File System tab, browse for and open the Fish_3.a3p file.

3. Using the Save As command from the file menu, rename the file to Fish_4.a3p.

4. If you are not already in the scene editor use the Setup Scene button to go to the scene editor.

In this lesson you will look at adding movement to whole and sub-parts of the objects in your animation.



Alice 3

www.oracle.com/academy

Page 2

2


Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trade-
marks of their respective owners.

5. To make your animation more engaging and lifelike you can move the sub-parts of your character mod-

els. From the object list menu choose the clown fish and then using the sub-part menus choose

getRightFrontFin from the joints menu.


6. The right front fin should turn backwards before the fish swims so drag a turn procedure above the first

move command in the clown fish code block using backwards and 0.125 as the arguments.

Page 3

3


Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trade-
marks of their respective owners.

7. You want to have the fin turn while the fish is moving forward to make it look like the fin is propelling the

fish. Add a do together statement under the fin turn statement


8. Drag the move forward statement from underneath into the do together control statement


9. Using the CTRL + mouse click method drag the fin statement into the do together and change the direc-

tion argument to forward.

Page 4

4


Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trade-
marks of their respective owners.

10. Complete the process until the code matches the following image:


11. When you test the animation you will see that the clown fish starts and stops abruptly. To change this

click on the add detail button, choose animation style and then choose begin abruptly and end gently.


12. Do the same for the other move statement in this code block.



13. At the end of the swimming the Blue tang fish should shake its head and say “no more swimming to-

day!”. Drag another do in order to the bottom of the existing code.

Page 5

5


Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trade-
marks of their respective owners.

14. Select the Blue Tang fish’s get head function and add the following three turn statements.




15. Select the Blue Tang fish from the object menu and add a say procedure that makes the fish say “No

more swimming today!”


16. Add a comment to the code block explaining that the blue tang will shake its head and display a mes-

sage to screen.

Similer Documents