Greenfoot Exercises

  1. Make a keyboard controlled actor (the player) and a bunch of actors moving back and forth, up and down. When the player moves his/her actor to touch one of the other actors the actor disappears.
  2. Draw your own car in inkscape, draw a left facing car and a right facing car. Save your images as png files and name them carLeft.png and carRight.png. Now, make an actor at the bottom of the screen and set the image to the car. Write code to make the car go back and forth on its own (using an xVelocity variable). When the car gets the the left side and is about to go right, set the image to be right facing so the car looks like it is going in the correct direction. When the car gets to the right side and is about to go left, set the image to be the left facing car so the car looks like it is going in the right direction.
  3. Create a game where you have an actor that is keyboard controlled moving left to right along the bottom. You have some number of objects (actors), lets say 5, falling from the sky. The number of falling objects should be a variable. The goal of the player is to catch the falling objects. When you catch an object the object disappears. Once you have caught all the objects a WinScreen appears (using setBackground). If any of the objects make it to the the ground (bottom of the screen) then you lose and a lose screen appears.
  4. Modify the game in exercise three to have the falling objects have more complicated movement patterns. Perhaps the spiral and swirl (think of modifying the dragonfly behavior from game4 in the example games). Or, perhaps the move away from the player as they approach the player. Or, perhaps both.