This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

GreenJava presents ...


Wombat Simulation (again)

This is my version of the Wombat Tutorial code with more features... that I used to help teach a quick introduction to programming presentation ...

It starts with a single wombat and leaf...
The wombat will be hungry unless you do something.

**** The Wombat Controls ****

You can right-click on it and askToAlwaysTurnRandomly()
or switch it back to the way it was before by askToAlwaysTurnLeft().
As previously, you can ask it to getLeavesEaten() and tell you.

On the side bar menu of Actor classes, you can right-click on a Rock, Wombat or Leaf, select new...() and then drag and drop it onto the sand.

**** The World Controls ****

In the World you can change the simulation by clicking on the desert floor (sandy background) and:

removeFirstWombatAndLeaf() or add them back with

populate() to add some Wombats, leaves and rocks.

randomLeaves() to add as many leaves as you want, but in random places.

randomRocks() to add as many rocks as you want, but in random places.

1933 views / 455 in the last 7 days

Tags: simulation demo with-source wombat

open in greenfoot
Your browser does not support the canvas tag.

No Comments

Want to leave a comment? You must first log in.

Who likes this?

No votes yet.