Greenfoot Project - Introduction, April 19, 2012, Cardinal Forest Elementary School

Greenfoot website

Back to Greenfoot Projects

  • Introduction to Greenfoot

    1. Open the Greenfoot wombat scenario

      The main Greenfoot window looks like this

      We are going to put wombats into this world. Here is a wombat:

      A quick way to do this is with "shift-left click"

    2. Create a new wombat and place the wombat into the world.

    3. Exercise: create more wombats, also create some leaves in your world.

    4. Look at the wombat's object menu and see what the wombat can do:

      Use the move and Turnleft of the wombat:

    5. "methods" have "return-types". Here is a boolean true/false return type.

    6. Exercise 1-3, using the return-type of CanMove

    7. Try out the GetLeavesEaten method, it returns how many leaves this wombat has eaten.

    8. Methods have parameters - these pass information in to the method

      Parameters have types too.

    9. Here is a method call dialog for the method setDirection. It takes in a number as a parameter.

      Invoke SetDirection with numbers to try it out.

    10. Place a wombat and many leaves into the world. The wombat can eat the leaves.

    11. Find out the difference between Act, Invoke, and Run