Package io.github.team6ENG.EscapeUni
Class Goose
java.lang.Object
io.github.team6ENG.EscapeUni.SpriteAnimations
io.github.team6ENG.EscapeUni.Goose
Represents and controls a goose
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleancom.badlogic.gdx.graphics.g2d.TextureRegionbooleanbooleanbooleanbooleanFields inherited from class io.github.team6ENG.EscapeUni.SpriteAnimations
animations, mapWallsId, tileDimensions, wallsLayer, x, y -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidGoose steals torchfloatget height of goose framefloatgetWidth()get width of goose framevoidloadBabyGoose(int gooseIndex) Recursively generate a trail of baby geese Each goose points to the next baby goose Base case: Goose index, only generate 5 geesevoidmoveGoose(float stateTime, float followX, float followY, boolean isPlayerMoving, boolean followIsSleeping) Move goose towards target and update animationsint[]Path for goose to run with torchMethods inherited from class io.github.team6ENG.EscapeUni.SpriteAnimations
dispose, generateAnimation, loadSprite
-
Field Details
-
isFacingLeft
public boolean isFacingLeft -
hasStolenTorch
public boolean hasStolenTorch -
currentGooseFrame
public com.badlogic.gdx.graphics.g2d.TextureRegion currentGooseFrame -
isFlying
public boolean isFlying -
baby
-
attackModeActivated
public boolean attackModeActivated -
isSleeping
public boolean isSleeping
-
-
Constructor Details
-
Goose
public Goose()Generate goose and its animations
-
-
Method Details
-
moveGoose
public void moveGoose(float stateTime, float followX, float followY, boolean isPlayerMoving, boolean followIsSleeping) Move goose towards target and update animations- Parameters:
stateTime- time in seconds since last framefollowX- x of targetfollowY- y of targetisPlayerMoving- is player moving
-
getWidth
public float getWidth()get width of goose frame- Returns:
- width of goose
-
getHeight
public float getHeight()get height of goose frame- Returns:
- height of goose
-
loadBabyGoose
public void loadBabyGoose(int gooseIndex) Recursively generate a trail of baby geese Each goose points to the next baby goose Base case: Goose index, only generate 5 geese- Parameters:
gooseIndex- number of current goose in the trail
-
attackMode
public void attackMode()Goose steals torch -
nextRunLocation
public int[] nextRunLocation()Path for goose to run with torch- Returns:
- destination coordinates
-