Package com.entities

Class Alien


  • public class Alien
    extends com.badlogic.gdx.graphics.g2d.Sprite
    Alien is a really simple sprite which also keeps track of how long it has been alive, and gives it certain properties depending on Constants.AlienType
    • Constructor Summary

      Constructors 
      Constructor Description
      Alien​(Constants.AlienType type, com.badlogic.gdx.math.Vector2 position)
      Constructor for Alien, which is called to spawn at a random position, remains there for a certain amount of time, and gives a certain amount of score depending on the type
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getScore()  
      long getSpawnTime()  
      • 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

      • Alien

        public Alien​(Constants.AlienType type,
                     com.badlogic.gdx.math.Vector2 position)
        Constructor for Alien, which is called to spawn at a random position, remains there for a certain amount of time, and gives a certain amount of score depending on the type
        Parameters:
        type - gives properties of the alien
        position - where it spawns on the screen
    • Method Detail

      • getScore

        public int getScore()
      • getSpawnTime

        public long getSpawnTime()