Defining the fish
In Angry Fish, we have five different kinds of fish. Since they will share a lot of common behavior, we will define a base Fish
class and inherit from Fish
to specialize the behavior wherever required.
The following table describes each fish in brief:
Type of fish |
Class |
Description |
---|---|---|
|
|
The simplest kind of fish that can be launched from the catapult |
|
|
Once launched, tapping the screen boosts this fish's velocity in the direction of motion |
|
|
Once launched, tapping the screen causes this fish to split into multiple smaller fish |
|
|
Once launched, tapping the screen causes this fish to hurl a smaller fish downwards |
|
|
Once launched, this fish automatically explodes after landing or hitting something |
The Fish class
We now define the base class for the fish. The Fish
class will inherit from parent class GameObject
, which is identical to the one you...