Methods for Self-referential Data; The World Library
Text as pdf
Text as html
The instructions for how to actually run your game will be posted here on Friday.
Due Date: Tuesday, February 5th, 2008 at 10:00 pm .
To run your game you need to do the following:
The class OceanWorld
should extend World
- so the first line of code after the three import statements and a comment what the program does will be:
class OceanWorld extends World{
Include in the definition of the class OceanWorld the following method:
// start the world and the timer boolean go() { return this.bigBang(300,200,0.05); }
where 300 is the width of the world, 200 is the height, and there is a new tick every 0.5 second.
Define the instance of the initial OceanWorld
in the Examples
class:
OceanWorld sfw = new OceanWorld(... );
After you run the program and see that all tests succeeded, in the Interactions window do the following:
> Examples e = new Examples(); > e.sfw.go()
and play the game.
Modified: February 2, 2008 8:00 am