Class Entity

    • Constructor Detail

      • Entity

        public Entity​(com.badlogic.gdx.math.Vector2 spawnPos,
                      com.badlogic.gdx.graphics.Texture img,
                      com.badlogic.gdx.math.Vector2 imSize,
                      int health)
        Parameters:
        spawnPos - The position the entity will spawn at.
        img - The texture of the entity.
        imSize - Size of the entity. Can be used to resize large/small textures
        health - Hit points of the entity
    • Method Detail

      • update

        public void update()
        Method is called every frame (If added to the gameobjects list in GameScreen)
        Specified by:
        update in class GameObject
      • isAlive

        public java.lang.Boolean isAlive()
        Checks if the Entity still has health and is not marked for removal
        Returns:
        alive Is health above 0 and is not marked for removal
      • applyDamage

        public void applyDamage​(float damage)
        Apply x amount of damage to the entity
        Parameters:
        damage - Amount of damage to inflict on the Entity
      • getHealthPoints

        public java.lang.Integer getHealthPoints()