Name: ______Date: ___April 29th, 2016___

Greenfoot Review

1.  What is the import line that must be at the top of every Greenfoot actor or world class?

import ______;

2.  Fill in the following blanks to create a world with a width of 1000 and a height of 800.

public class ______extends ______{

public ______() {

super(______);
}

}

3.  Write the TYPE of data that the following world class methods take in as parameters in the blanks.

Note: There may be more than one parameter necessary, use commas!

addObject(______);

removeObject(______);

setBackground(______);

setPaintOrder(______);

4.  Write the TYPE of data that the following actor class methods take in as parameters in the blanks.

Note: There may be more than one parameter necessary, use commas!

move(______);

turn(______);

setLocation(______);

setRotation(______);

isTouching(______);

setImage(______);

5.  Write the TYPE of data that the following methods return.

getImage returns ______

getX() and getY() return an ______

isTouching returns ______

isKeyDown returns ______

6.  Write code to change the world to the world “LevelTwo”:

______

7.  Write code to play the sound “point.wav” once:

______

8.  Write code to create a new blank image that is 1000 by 800:

______

9.  Write code to initialize an image from the file “Mario.png”:

______

10.  Write code to check if the up arrow is pressed:

______

11.  Write code to remove this actor when it touches Wall.class:

______

12.  Write code to move this actor one pixel upward:

______

13.  Write code to move this actor one pixel to the left:

______

14.  Write code to scale this actor’s image to 100 by 100:

______

15.  Write code to mirror this actor’s image horizontally:

______

16.  Write code to draw some text onto a GreenfootImage:

______

17.  TRUE OR FALSE: A class in Java must have at least one constructor: ______

18.  TRUE OR FALSE: A class in Java can have more than one constructor: ______

19.  TRUE OR FALSE: A class in Java can call private methods from another class: ______

20.  TRUE OR FALSE: Greenfoot’s isKeyDown method takes in a String and returns a boolean: ______