Exploring Programming
|
Academics
|
Middle School
|
The American School in Japan
![]()
Assignment 1
The goal of this assignment is to begin a simple game. The game will be similar to the one demonstrated in class where some sort of rotates, fires a projectile, then has it expand at the end. Your assignment for the next two classes is to write a program that will create and rotate a figure, fire a projectile that leaves a dotted track, then has a rotating expanding figure on the end to indicate an explosion. We have done parts of all of these in class.
Name the entry subroutine for your program "action" and pass it to variables, :distance and :angle, which tell what angle to rotate to and the distance it should shoot. So, are you feeling confused? The first line of that subroutine is:
to action :distance :angle
Doesn't this seem somewhat like the "rotate" and "rotatecenter" subroutines we created except instead of rotating a square you are rotating a slightly more complex device? (You can find "rotate" and "rotatecenter" in the programs on the O: drive), and doing one more action, which is shooting the projectile.
The red
figure on the left is one possibility for the device, but you may make it
simpler. The guide line is that it must be more complex than just a
rectangle.
As you create this, think about what point the figure will rotate about, and make sure that the projectile comes from the middle of the device.
One last message: Work together on this and help each other. When I return, I will ask you to evaluate the effort and cooperation of the others in the class.
Created March, 2001
Last Maintained 04/09/03
Owner: D. Fincher (dfincher@asij.ac.jp)