package class2_1_DuckStrategies_v7_Factory.ducks; import class2_1_DuckStrategies_v7_Factory.NoQuacking; import class2_1_DuckStrategies_v7_Factory.RandomSwimming; import java.awt.Point; /** * This class represents a specialized type of Duck * @author hornick */ public class RubberDuck extends Duck { /** * RubberDuck-specific constructor */ public RubberDuck(String name) { super(name, "rubber.jpg"); this.setBehaviors(new RandomSwimming(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, random.nextInt(3)+1 ); } }