The move
method in class Fish
should contain all the move functions of the tail, the body, and the eye. Therefore, when you call the move
method in main
, the entire parts of the fish will move at the same time.
It isn't necessary but you can create a list of objects to group them all and using the for loop
to move each object at the same time (just like what we will do in setupFish()
and setupBubble()
)