The goal of this homework is to practice the coding of a simple kinematics-based behavior using vectors in Unity.
Implement a simple demonstration in Unity of the firing solution algorithm specified by the pseudo-code on slide 16 of the physics lecture notes:
- Use a simple cylinder for the "cannon", a sphere for the projectile, and a cube for the target (all on a plane).
- Provide some simple interface (such as arrow keys) to move the target.
- The inclination angle of the cannon should automatically adjust so that the projectile will hit the target (in minimum time) or give some indication if the target is out of range.
- Provide a simple interface (such as a key press) to fire the cannon and show the movement of the projectile in the correct parabola landing on the target.
You may discuss this homework with others, but you must write all the code yourself (see cheating policies).
- Build a web player executable for your demonstration:
- Select your scene
- File > Build Settings > Web Player > Build
- Test the web executable by clicking on the .html file in the folder created by
the build command.
- Copy all of the scripts you created to the folder created
by the build command above.
- Zip the web folder. Thus we can play the game to see what it does and look at your scripts
to see what you've done.
- Log into Turnin using your WPI user id and the password you were mailed.
- Select the IMGD 4000 area of turnin (if necessary) and submit the zip file under "Firing Solution". (If your submission times out, try again.)
If the demo works completely and correctly, then an additional 5% extra credit will be awarded on the final term grade. Partial credit is also possible (see grading).