package class2_1_DuckStrategies_v7_Factory.ducks; import class2_1_DuckStrategies_v7_Factory.HorizontalSwimming; import class2_1_DuckStrategies_v7_Factory.NoQuacking; import java.awt.Point; /** * This class represents a specialized type of Duck * @author hornick */ public class Decoy extends Duck { /** * Decoy-specific constructor */ /* package */ Decoy(String name) { super(name,"decoy.jpg"); this.setBehaviors(new HorizontalSwimming(this), new NoQuacking()); // this value defines how far the duck moves each update period - s random value between 1 and 3. increment = new Point(random.nextInt(3)+1, 0 ); } }