AP CS A - Gorilla Application

Used during 2006/2007 School Year


Prerequisite Knowledge

Project is great after students have learned about all of the different methods used in the Math class and understand loops. This is a game which uses a physics formula for the range of a projectile in order to aim at a target. Knowing the Math class methods is essential.

Premise / Development

The object of the game is for the gorilla to throw a banana attempting to hit a predetermined target. In class, we made this target a random distance away from the gorilla. We defined the target as a 2m wide target on a course which is 2m - 500m away from the gorilla. The user enters an initial velocity and throwing angle in attemps to hit a target. The following diagram will help describe the course and formula utilitized...
gorillla1.gif

Game Play

- The computer determines the target by using random numbers
- The user enters an initial velocity and angle to throw the object
- Once thrown, the computer calculates if the target was hit
- If the target is not hit, it displays for the user how far away they are from the target (i.e. 5m long, 3.3m short)
- We chose to have the computer tell us if we were short or long, because the older QBasic version you could actually watch and see if it was too far.
- The students created messages if someone enters an angle that doesn't make sense. Such as -2, 0, or anything greater than 90.

Teacher to Teacher

The students really enjoyed creating this simple game at the beginning of the course. It allowed me to see their skills concerning the Math class, Random numbers, and loops come together in one nice package. They also had to be able to create a usuable user interface given the fact that we created an application, not an applet. I really enjoyed this project and gave the students a weekend to complete the assignment.