Package com.sprites

Class PowerupSprite


  • public class PowerupSprite
    extends com.badlogic.gdx.graphics.g2d.Sprite
    This sprite can be located around the map and when a player drives over it, the power up will be applied
    • Constructor Summary

      Constructors 
      Constructor Description
      PowerupSprite​(java.lang.String type, java.util.ArrayList<com.badlogic.gdx.graphics.Texture> textureSlices, float x, float y, int difficulty)
      Constructor for powerup sprite
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void action​(Firetruck activeFireTruck)
      Applies a powerup effect to the active truck
      com.badlogic.gdx.math.Polygon getHitBox()  
      void update​(com.badlogic.gdx.graphics.g2d.Batch batch)
      Draw the sprite
      • Methods inherited from class com.badlogic.gdx.graphics.g2d.Sprite

        draw, draw, flip, getBoundingRectangle, getColor, getHeight, getOriginX, getOriginY, getRotation, getScaleX, getScaleY, getVertices, getWidth, getX, getY, rotate, rotate90, scale, scroll, set, setAlpha, setBounds, setCenter, setCenterX, setCenterY, setColor, setColor, setFlip, setOrigin, setOriginBasedPosition, setOriginCenter, setPackedColor, setPosition, setRegion, setRotation, setScale, setScale, setSize, 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

      • PowerupSprite

        public PowerupSprite​(java.lang.String type,
                             java.util.ArrayList<com.badlogic.gdx.graphics.Texture> textureSlices,
                             float x,
                             float y,
                             int difficulty)
        Constructor for powerup sprite
        Parameters:
        type - the type of powerup that will be spawned
        textureSlices - the built array of textures that will be used to draw the 3d sprite
        x - coordinate where the sprite spawns
        y - coordinate where the sprite spawns
        difficulty - the current game difficulty
    • Method Detail

      • update

        public void update​(com.badlogic.gdx.graphics.g2d.Batch batch)
        Draw the sprite
        Parameters:
        batch - to be drawn to
      • action

        public void action​(Firetruck activeFireTruck)
        Applies a powerup effect to the active truck
        Parameters:
        activeFireTruck - The active truck to apply the effect to
      • getHitBox

        public com.badlogic.gdx.math.Polygon getHitBox()