import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class Enemy3 here. * * @author (Quinn Sapp) * @version (5 July 2013) */ public class Enemy3 extends Animal { private int speed = 4; private int leftTurn = 450; private int rightTurn = 450; /** * */ public void act() { setLocation ( getX() + speed, getY() ); Actor actor = getOneIntersectingObject(null); if(actor != null) { actor.setLocation ( actor.getX() + speed, actor.getY() ); } if (atTurningPoint()) { speed = -speed; } } /** * */ public boolean atTurningPoint() { return (getX() <= leftTurn || getX() >= rightTurn); } }