Class ItemBomb

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class ItemBomb
    extends Item
    Item, that simply makes the figure explode when picked up (if it has no BombKit).
    See Also:
    Serialized Form
    • Constructor Detail

      • ItemBomb

        public ItemBomb()
        Creates a new ItemBomb.
    • Method Detail

      • onBePickedUp

        protected boolean onBePickedUp​(Figure picker,
                                       AnimationInfo animation)
        Should be overridden in subclasses to implement the pick up behaviour. The method is called, if a user picks up an item, after checking if item is exploding, is a bomb etc.
        Overrides:
        onBePickedUp in class Item
        Parameters:
        picker - The picker.
        animation - The AnimationInfo.
        Returns:
        Returns false to indicate that the item is not kept after being picked up.
      • getPainterClassname

        public java.lang.String getPainterClassname()
        Gets the fully qualified classname of the Painter to use for this item (in 2D game).
        Overrides:
        getPainterClassname in class Item
        Returns:
        "com.starpoints.painter.arena2D.PainterItemBomb"
      • getItemRating

        public int getItemRating()
        Returns an item value for ComputerFigures rating in the items category.
        Overrides:
        getItemRating in class Item
        Returns:
        -100000.
      • getImageName

        public java.lang.String getImageName​(AnimationInfo animation)
        Returns image name.
        Overrides:
        getImageName in class Thing
        Parameters:
        animation - The AnimationInfo.
        Returns:
        "item_coin"+money+"_"+0-3.