Package com.entities
Class ETFortress
- java.lang.Object
-
- com.badlogic.gdx.graphics.g2d.TextureRegion
-
- com.badlogic.gdx.graphics.g2d.Sprite
-
- com.sprites.SimpleSprite
-
- com.entities.ETFortress
-
public class ETFortress extends SimpleSprite
The ET Fortress implementation, a static sprite in the game.- Since:
- 16/12/2019
-
-
Constructor Summary
Constructors Constructor Description ETFortress(com.badlogic.gdx.graphics.Texture texture, com.badlogic.gdx.graphics.Texture destroyedTexture, float scaleX, float scaleY, float xPos, float yPos, Constants.FortressType type, GameScreen gameScreen)Overloaded constructor containing all possible parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanShootProjectile()Check to see if the ETFortress should fire another projectile.voiddrawDebug(com.badlogic.gdx.graphics.glutils.ShapeRenderer renderer)Overloaded method for drawing debug information.Constants.FortressTypegetType()booleanisFlooded()booleanisInRadius(com.badlogic.gdx.math.Vector2 position)Simple method for detecting whether a vector, fire truck, is within attacking distance of that fortress' rangevoidupdate(com.badlogic.gdx.graphics.g2d.Batch batch)Update the fortress so that it is drawn every frame.-
Methods inherited from class com.sprites.SimpleSprite
decreaseInternalTime, dispose, getCentre, getCentreX, getCentreY, getDamageHitBox, getHealthBar, getHeight, getInternalTime, getMovementHitBox, getWidth, removeSprite, resetRotation, rotate, setInternalTime, setMovementHitBox, setSize
-
Methods inherited from class com.badlogic.gdx.graphics.g2d.Sprite
draw, draw, flip, getBoundingRectangle, getColor, getOriginX, getOriginY, getRotation, getScaleX, getScaleY, getVertices, getX, getY, rotate90, scale, scroll, set, setAlpha, setBounds, setCenter, setCenterX, setCenterY, setColor, setColor, setFlip, setOrigin, setOriginBasedPosition, setOriginCenter, setPackedColor, setPosition, setRegion, setRotation, setScale, setScale, setU, setU2, setV, setV2, setX, setY, translate, translateX, translateY
-
Methods inherited from class com.badlogic.gdx.graphics.g2d.TextureRegion
getRegionHeight, getRegionWidth, getRegionX, getRegionY, getTexture, getU, getU2, getV, getV2, isFlipX, isFlipY, setRegion, setRegion, setRegion, setRegion, setRegionHeight, setRegionWidth, setRegionX, setRegionY, setTexture, split, split
-
-
-
-
Constructor Detail
-
ETFortress
public ETFortress(com.badlogic.gdx.graphics.Texture texture, com.badlogic.gdx.graphics.Texture destroyedTexture, float scaleX, float scaleY, float xPos, float yPos, Constants.FortressType type, GameScreen gameScreen)Overloaded constructor containing all possible parameters. Drawn with the given texture at the given position.- Parameters:
texture- The texture used to draw the ETFortress with.destroyedTexture- The texture used to draw the ETFortress with. when it has been destroyed.scaleX- The scaling in the x-axis.scaleY- The scaling in the y-axis.xPos- The x-coordinate for the ETFortress.yPos- The y-coordinate for the ETFortress.type-Constants.FortressTypegiven to fortressgameScreen- GameScreen to send popup messages to
-
-
Method Detail
-
update
public void update(com.badlogic.gdx.graphics.g2d.Batch batch)
Update the fortress so that it is drawn every frame.- Overrides:
updatein classSimpleSprite- Parameters:
batch- The batch to draw onto.
-
canShootProjectile
public boolean canShootProjectile()
Check to see if the ETFortress should fire another projectile. The pattern the ETFortress uses to fire can be modified here.- Returns:
- boolean Whether the ETFortress is ready to fire again (true) or not (false)
-
isInRadius
public boolean isInRadius(com.badlogic.gdx.math.Vector2 position)
Simple method for detecting whether a vector, fire truck, is within attacking distance of that fortress' range- Parameters:
position- vector to check- Returns:
trueposition is within rangefalseotherwise
-
drawDebug
public void drawDebug(com.badlogic.gdx.graphics.glutils.ShapeRenderer renderer)
Overloaded method for drawing debug information. Draws the hitbox as well as the range circle.- Overrides:
drawDebugin classSimpleSprite- Parameters:
renderer- The renderer used to draw the hitbox and range indicator with.
-
isFlooded
public boolean isFlooded()
-
getType
public Constants.FortressType getType()
-
-