Class PainterItemDriller


  • public class PainterItemDriller
    extends PainterItem
    Painter for SwampGhost.
    • Constructor Detail

      • PainterItemDriller

        public PainterItemDriller​(PainterFactory painterFactory)
        Creates a PainterLaserTower.
        Parameters:
        painterFactory - The Painter factory.
    • Method Detail

      • paintDrilling

        public void paintDrilling​(Graphics g,
                                  ThingState t,
                                  GameState state,
                                  int xCenter,
                                  int yCenter,
                                  int repaintCounter)
        Paint the aim effect.
        Parameters:
        g - The graphics to paint on
        t - The driller.
        xCenter - The xcenter coordinate on the screen
        yCenter - The ycenter coordinate on the screen
        repaintCounter - The repaintCounter.
      • paintItemOnFigureOverlay

        public void paintItemOnFigureOverlay​(Graphics g,
                                             FigureState f,
                                             ItemState item,
                                             GameState state,
                                             int xCenter,
                                             int yCenter,
                                             int repaintCounter)
        Paints on overlay for the item while on the figure. Called, even if figure is invisible.
        Overrides:
        paintItemOnFigureOverlay in class PainterItem
        Parameters:
        g - The graphics.
        f - The figure.
        item - The item.
        xCenter - x Ccenter coordinate.
        yCenter - y Ccenter coordinate.
        repaintCounter - repaintCounter.
      • straightMoveFactor

        protected double straightMoveFactor​(int source,
                                            int target)
        Calculates the movement per animation cycle.
        Parameters:
        source - Source coordinate.
        target - Target coordinate.
        Returns:
      • animationIndex

        protected int animationIndex​(GameState state,
                                     int repaintCounter)
        Calculates the animation index based on rocket speed and frame rate.
        Parameters:
        state -
        Returns: