Hi, I'm encountering an error "cannot find symbol method canSee in the shotsFired method.
*Note: This is not my project, I am modifying it for school-related purposes.*
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.awt.Point;
/**
* Write a description of class Soldier here.
*
* @author Taylor Born
* @version May 2012
*/
public class Soldier extends Unit
{
private static final int ROTATION_SPEED = 3;
private static final double ACCELERATION = .15;
private static final double MAX_SPEED = 2.5;
public int shotsFired=0;
protected void handlePlayer()
{
super.handlePlayer();
speed = MAX_SPEED;
if (Greenfoot.isKeyDown("w"))
move(270, false);
else if (Greenfoot.isKeyDown("s"))
move(90, false);
if (Greenfoot.isKeyDown("a"))
move(180, false);
else if (Greenfoot.isKeyDown("d"))
move(0, false);
speed = 0;
Point p = ((Terrain)getWorld()).getLastMouse();
turnTowards((int)p.getX(), (int)p.getY());
if (KeysPressed.testKey("r"))
{
Vehicle v = (Vehicle)getOneIntersectingObject(Vehicle.class);
if (v != null)
((Terrain)getWorld()).enterVehicle(v);
}
}
protected void fire()
{
if (isPlayer())
getWorld().addObject(new Projectile(Greenfoot.isKeyDown("a") ? -1 : Greenfoot.isKeyDown("d") ? 1 : 0, Greenfoot.isKeyDown("w") ? -1 : Greenfoot.isKeyDown("s") ? 1 : 0, MAX_SPEED, getRotation()), getX() + (int)(Math.cos(Math.toRadians(getRotation())) * (-14 + 26) + Math.cos(Math.toRadians(getRotation() + 90)) * (-14 + 19)), getY() + (int)(Math.sin(Math.toRadians(getRotation() + 90)) * (-14 + 19) + Math.sin(Math.toRadians(getRotation())) * (-14 + 26)));
else
getWorld().addObject(new Projectile(getRotation(), speed, getRotation()), getX() + (int)(Math.cos(Math.toRadians(getRotation())) * (-14 + 26) + Math.cos(Math.toRadians(getRotation() + 90)) * (-14 + 19)), getY() + (int)(Math.sin(Math.toRadians(getRotation() + 90)) * (-14 + 19) + Math.sin(Math.toRadians(getRotation())) * (-14 + 26)));
}
protected void slowDown()
{
if (Math.abs(speed) < .1)
speed = 0;
else if (speed > 0)
speed -= speed / 10;
else if (speed < 0)
speed += -speed / 10;
}
protected boolean canTurnWhenStill()
{
return true;
}
protected int getRotationSpeed()
{
return ROTATION_SPEED;
}
protected double getAcceleration()
{
return ACCELERATION;
}
protected double getMaxSpeed()
{
return MAX_SPEED;
}
protected boolean hitsSomething()
{
return super.hitsSomething() || hitsFence() || hitsTree() || hitsLandUnits();
}
public void shotsFired()
{
if (canSee (Projectile.class) )
{
shotsFired++;
System.out.println (shotsFired);
}
}
}

