Package fr.formiko.kokcinelo.model
Class Aphid
java.lang.Object
fr.formiko.kokcinelo.model.MapItem
fr.formiko.kokcinelo.model.Creature
fr.formiko.kokcinelo.model.Aphid
- Direct Known Subclasses:
HealthAphid
,ScoreAphid
,SpeedAphid
,VisibilityAphid
Aphids are Creatures eated by ladybugs.
Ant always try to protect them.
- Since:
- 0.1
- Version:
- 2.5
-
Field Summary
Fields inherited from class fr.formiko.kokcinelo.model.Creature
canFly, collectedFrequency, currentSpeed, defaultMoveFrontSpeed, fliing, hearRadius, hitFrequency, hitPoints, lastCollectedTime, lastHitTime, lastRunTime, lastShootTime, lifePoints, maxLifePoints, movingSpeed, ORDER, runFrequency, shootFrequency, shootPoints, shootRadius, visionRadius, wantedRotation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
bonusWhenCollectHoneydew
(Creature collector) Give bonus to collector when honeydew is collected.void
bonusWhenEaten
(Creature eater) Give bonus to eater when aphid is eaten.void
collectHoneydew
(Creature collector) Collect honeydew of this.void
Color aphid skeleton with aphid color.float
com.badlogic.gdx.graphics.Color
getColor()
int
float
boolean
void
setHoneydewVisibility
(boolean visible) Set honeydew visibility.void
Update honeydew visibility depending of last collected time.Methods inherited from class fr.formiko.kokcinelo.model.Creature
addScore, addTime, boost, canBeCollected, canHit, canRun, canShoot, closestCreature, die, getAllFriendlyCreature, getAllFriendlyWithVisibilityCreature, getClosestVisibleCreatureToHunt, getCollectedFrequency, getCreaturesToHunt, getCurrentSpeed, getDefaultMoveFrontSpeed, getHearRadius, getHitPoints, getLastCollectedTime, getLifePoints, getMaxLifePoints, getMovingSpeed, getShootPoints, getShootRadius, getSpaceActionProgress, getVisibleCreatureHuntedBy, getVisionRadius, getWallsAngles, getWantedRotation, goTo, goTo, goTo, goTo, haveCreatureHuntedBy, haveCreatureToHunt, hit, isAI, isAlive, isFriendly, isFriendlyWithVisibility, isTooCloseForStart, minorRandomRotation, moveAI, moveFront, moveFront, run, runAwayFrom, see, seeableCreatures, setCollectedFrequency, setCurrentSpeed, setDefaultMoveFrontSpeed, setHearRadius, setHitPoints, setLastCollectedTime, setLifePoints, setMaxLifePoints, setMovingSpeed, setShootPoints, setShootRadius, setVisionRadius, setWantedRotation, shoot, stayInMap, toString
Methods inherited from class fr.formiko.kokcinelo.model.MapItem
distanceTo, distanceTo, equals, getActor, getCenter, getCenterX, getCenterY, getHitRadius, getId, getRotation, getZoom, hashCode, hitBoxConnected, isInRadius, moveIn, removeActor, setCenter, setCenterX, setCenterY, setRandomLoaction, setRotation, setZoom
-
Constructor Details
-
Aphid
public Aphid()Main Constructor with all default params: aphid texture, low life points, no hit points, no shoot points, a small visionRadius & a small hit radius.
-
-
Method Details
-
getGivenPoints
public int getGivenPoints()- Overrides:
getGivenPoints
in classCreature
-
getMaxRotationPerSecond
public float getMaxRotationPerSecond()- Overrides:
getMaxRotationPerSecond
in classCreature
-
getCreaturesHuntedBy
- Overrides:
getCreaturesHuntedBy
in classCreature
-
getAnimationSpeedMultiplier
public float getAnimationSpeedMultiplier()- Overrides:
getAnimationSpeedMultiplier
in classCreature
-
getColor
public com.badlogic.gdx.graphics.Color getColor() -
isHoneydewReady
public boolean isHoneydewReady() -
getCreaturesFriendly
- Overrides:
getCreaturesFriendly
in classCreature
-
getCreaturesFriendlyWithVisibility
- Overrides:
getCreaturesFriendlyWithVisibility
in classCreature
-
getSpaceActionName
- Overrides:
getSpaceActionName
in classCreature
-
colorSkeleton
public void colorSkeleton()Color aphid skeleton with aphid color. It color each body part that contains "background" in its name. -
bonusWhenEaten
Give bonus to eater when aphid is eaten.- Parameters:
eater
- The creature that eat the aphid.
-
bonusWhenCollectHoneydew
Give bonus to collector when honeydew is collected.- Parameters:
collector
- The creature that collect the honeydew.
-
updateHonewdewVisibility
public void updateHonewdewVisibility()Update honeydew visibility depending of last collected time. -
setHoneydewVisibility
public void setHoneydewVisibility(boolean visible) Set honeydew visibility. It set the scale of honeydew bone to 0 or 1.- Parameters:
visible
- True if honeydew is visible, false otherwise.
-
collectHoneydew
Collect honeydew of this. It set lastCollectedTime to current time and give bonus to collector.
-