Greenfoot (Java microworld)

5

Description

http://image.versiontracker.com/scrnsht/143729/396616/275screen-lunarlander.jpg

Consider greenfoot as a combination between a framework for creating two-dimensional grid assignments in Java and an integrated development environment (class browser, editor, compiler, execution, etc.) suitable for novice programmers. While greenfoot supports the full Java language, it is especially useful for programming exercises that has a visual element. In greenfoot object visualisation and object interaction are the key elements.

If you know BlueJ and a microworld framework (like Karel the Robot or the AP Marine Biology Case Study) consider greenfoot as the best from both: object interaction (BlueJ) and object visualisation (microworlds).

The Framework

The framework can be used to create a wide range of programs that can be visualised in a two-dimensional grid. Popular examples of such programs often used in an educational setting includes: The 8 Queen Puzzle, Karel the Robot, Conway's Game of Life, The AP Marine Biology Case Study and Turtle Graphics,

The framework in greenfoot has two main responsibilities:

  1. Make it easy to create graphical representations of objects.
  2. Control the execution (start, stop, step) of a simulation loop.

To accomplish these things the greenfoot framework supplies a base class GreenfootObject which should be extended by all classes that wish to visualise themselfes. The two most important methods that must be implemented are the getImage() method which should return the image of the object, and the act() method which will be called in each step of the simulation loop.

Scenarios are a set of classes typically created by the teacher/instructor that implements the base classes for a specific application. The idea is that the student gets an interesting framework that can be modified and extended to create even more interesting functionality. A scenario could for instance be one of the programs mentioned above. Below you can see screenshots of a turtle graphics scenario and a Karel the Robot scenario.

The integrated development environment

The greenfoot environment contains the typical elements of a development environment:

  • A source code editor
  • A class browser
  • Compilation
  • Execution control
  • A debugger

In addition greenfoot can visualise the objects from a greenfoot scenario, and interact with these. It can control the execution of the execution loop of a greenfoot scenario.

The most important feature of greenfoot that sets it apart from other development environments is the direct interaction.

Who should use greenfoot?

Greenfoot is aimed at high school level or below. When designing the greenfoot system we tried to consider both the students and the teachers.

The students at high school levels might not be as commited to programming and we have tried to create an interesting program that should engage the student. In order to do this, we acknowledge that students has different opinions on what might be interesting. Hence, we sought to create a flexible environment that could be customised for the specific group of students. Furthermore, in the design of greenfoot we considered the different learning styles of students.

Resource Links

Comments (1)

#1 February 10, 2009 at 5:36 pm - by ecowannabe
If you want to see a LOT of examples of games and simluations people have created using greenfoot, go to the Greenfoot Gallery.  Look at the scenarios in the tag with-source if you want to find the ones that will let you download the source code.  If you download greenfoot (the tool) and then download the source code for a scenario from the gallery, you can use greenfoot to open the scenario and see how it works, make changes, break it, fix it, improve it, whatever you want to do.  The code is in the Java programming language, but even if you don't know java, this can be a fun way to start learning it, by messing around with an existing scenario and making small changes.  There are some good beginner tutorials on the greenfoot.org website also, as mentioned above.