Greenfoot: Asteroids Lab




Assignment

These exercises are taken from the official Greenfoot book by Michael Kolling and repeated here for convenience.

  1. Find the variable in the game that controls how often the gun can fire. Change its value so that it fires more often.

  2. After playing the game for a while, press "pause." Now try to determine how many shots you have fired. Hint: You will need to query the rocket object.

  3. What is the initial speed of the rocket after it is placed on the board?

  4. What is the initial stability value of an asteroid once it is created? Do bigger asteroids have more initial stability than smaller ones? By how much does this value decrease it time it is hit with a bullet?

Ask your instructor how to submit the answers to these questions to get credit for this assignment.