Class Bullet



  • public class Bullet
    extends MovableEntity
    A bullet is a moving object which can destroy and damage entities or the world.
    See Also:
    Serialized Form
    • Method Detail

      • spawn

        public MovableEntity spawn​(Point point)
        Description copied from class: AbstractEntity
        Add this entity to the map-> let it spawn
        Overrides:
        spawn in class MovableEntity
        Parameters:
        point - the point in the game world where the object is. If it was previously set this is ignored.
        Returns:
        returns itself
      • update

        public void update​(float dt)
        Description copied from class: MovableEntity
        Updates the character. Applies gravitation.
        Overrides:
        update in class MovableEntity
        Parameters:
        dt - time since last update in ms
      • setMaxDistance

        public void setMaxDistance​(float maxDistance)
        Parameters:
        maxDistance - in game space
      • setDamage

        public void setDamage​(byte damage)
        Parameters:
        damage -
      • setExplosive

        public void setExplosive​(int ex)
        Parameters:
        ex -
      • setImpactSprite

        public void setImpactSprite​(int id)
        Set the sprite which get spawned when the bullet hits.
        Parameters:
        id - if you don't want an impact sprite set id to0.
      • getDistance

        public int getDistance​()
        Returns:
        the distance traveled.
      • ignoreCoord

        public void ignoreCoord​(Coordinate coord)
        Parameters:
        coord -
      • handleMessage

        public boolean handleMessage​(com.badlogic.gdx.ai.msg.Telegram msg)
        Overrides:
        handleMessage in class MovableEntity