Package com.sprites
Class PowerupSprite
- java.lang.Object
-
- com.badlogic.gdx.graphics.g2d.TextureRegion
-
- com.badlogic.gdx.graphics.g2d.Sprite
-
- com.sprites.PowerupSprite
-
public class PowerupSprite extends com.badlogic.gdx.graphics.g2d.SpriteThis 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 voidaction(Firetruck activeFireTruck)Applies a powerup effect to the active truckcom.badlogic.gdx.math.PolygongetHitBox()voidupdate(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
-
-
-
-
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 spawnedtextureSlices- the built array of textures that will be used to draw the 3d spritex- coordinate where the sprite spawnsy- coordinate where the sprite spawnsdifficulty- 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()
-
-