View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide

How to add subclasses of Fish

To add a new subclass of fish you need to create a class that extends the Fish class.

In this new class you will need to provide constructors. You can copy the Fish constructor headers and simply call the Fish constructors using super(paramList).

You need to override the generateChild method so that the children of your new type of fish will be the same type.

You will need to override act or move or die or whatever you want to be different than Fish.

You will need to edit MBSGUI.java and add the new class to the list of fish classes and add some way to display your new class.

See HungryFish.java and this MBSGUI.java for an example.