ppJava.serie04.oceanlife
Class Fish
java.lang.Object
ppJava.serie04.oceanlife.OceanObject
ppJava.serie04.oceanlife.Fish
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Runnable
public class Fish
- extends OceanObject
A fish, swimming in the ocean
- Author:
- ken, bpei
- See Also:
- Serialized Form
Constructor Summary |
Fish(int x,
int y)
Constructor for a fish at position (x,y) |
Methods inherited from class ppJava.serie04.oceanlife.OceanObject |
calcAbsDistance, checkBarrier, checkPosition, createImageIcon, genRandomVector, getBarrier, getBorders, getClassName, getDiffVector, getDistance, getImageIcon, getImageResource, getImageSize, getMoveVector, getObjectCount, getOffset, getPosition, hasSameDirection, incPosX, incPosY, isVulnerableTo, moveStep, normalizeImage, setBarrier, setBorders, setImageIcon, setImageResource, setImageSize, setMoveVector, setOffset, setPosition, switchMovementDirection |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
randomSprite
int randomSprite
imageSizes
int[] imageSizes
imageNormalResource
java.lang.String imageNormalResource
imageReversedResource
java.lang.String imageReversedResource
paddingBorder
int paddingBorder
Fish
public Fish(int x,
int y)
- Constructor for a fish at position (x,y)
- Parameters:
x
- y
-
toString
public java.lang.String toString()
- Overrides:
toString
in class OceanObject
flipImage
public void flipImage()
- Turn around the image
changeDirections
public void changeDirections(OceanObject tempRefObject)
- Change the directions and turn around the image
- Overrides:
changeDirections
in class OceanObject
run
public void run()
- The movement of a fish