package edu.stuy.starlorn.entities;

public class EnemyShip extends Ship {

    public EnemyShip() {
        super();
        _baseAim = Math.PI/2; // Aim down
    }

}

@@ -34,130 +34,1416 @@
 s;%0A%0A
-public class EnemyShip extends Ship %7B%0A%0A    public EnemyShip() %7B%0A        super();%0A        _baseAim = Math.PI/2; // Aim down
+import edu.stuy.starlorn.world.Path;%0A%0Apublic class EnemyShip extends Ship %7B%0A    protected Path _path;%0A    protected int _pathIndex; // Index of our location on the path%0A%0A    public EnemyShip() %7B%0A        super();%0A        _baseAim = Math.PI/2; // Aim down%0A        _path = null;%0A        _pathIndex = 0;%0A    %7D%0A%0A    public EnemyShip(Path p) %7B%0A        this();%0A        _path = p;%0A    %7D%0A%0A    @Override%0A    public void preStep() %7B%0A        super.preStep();%0A        // If we're at our goal coordinate on the path, advance our goal and set our velocity to aim at the next goal%0A        if (Math.round(_xcor) == Math.round(_path.getCoords(_pathIndex)%5B0%5D)%0A        && Math.round(_ycor) == Math.round(_path.getCoords(_pathIndex)%5B1%5D)) %7B%0A            _pathIndex++;%0A            int relativeX = (int) _xcor - _path.getCoords(_pathIndex)%5B0%5D;%0A            int relativeY = (int) _ycor - _path.getCoords(_pathIndex)%5B1%5D;%0A            double theta = Math.atan2(relativeX, relativeY);%0A            _xvel = _movementSpeed * Math.cos(theta);%0A            _yvel = _movementSpeed * Math.sin(theta);%0A        %7D%0A%0A        // If we're done with our path, just despawn%0A        if (_pathIndex %3E= _path.getPathLength()) %7B%0A            _world.removeEntity(this);%0A        %7D%0A    %7D%0A%0A    public void setPath(Path p) %7B%0A        _path = p;%0A    %7D%0A%0A    public Path getPath() %7B%0A        return _path;%0A    %7D%0A%0A    public int getPathIndex() %7B%0A        return _pathIndex;
 %0A   

Remove EnemyShips that are done with their path.