Package com.entities

Class 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
      boolean canShootProjectile()
      Check to see if the ETFortress should fire another projectile.
      void drawDebug​(com.badlogic.gdx.graphics.glutils.ShapeRenderer renderer)
      Overloaded method for drawing debug information.
      Constants.FortressType getType()  
      boolean isFlooded()  
      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
      void update​(com.badlogic.gdx.graphics.g2d.Batch batch)
      Update the fortress so that it is drawn every frame.
      • 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.FortressType given to fortress
        gameScreen - 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:
        update in class SimpleSprite
        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:
        true position is within range false otherwise
      • 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:
        drawDebug in class SimpleSprite
        Parameters:
        renderer - The renderer used to draw the hitbox and range indicator with.
      • isFlooded

        public boolean isFlooded()