Here's what I've got:
The line I've commented on is the line that is unreachable , I'm just starting to learn Java so could someone explain why this is unreachable to me please.
Thanks a lot,
Hawx
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Mine2 here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Mine2 extends Actor
{
/**
* Act - do whatever the Mine2 wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
move();
location();
intersect();
}
private void move()
{
move(-(Greenfoot.getRandomNumber (10)));
}
private void location()
{
if (getX() <= 5)
{
Mine mine = new Mine();
{ setLocation(596,(Greenfoot.getRandomNumber (300))); }
}
}
private void intersect()
{
Actor Rocket = getOneIntersectingObject(Rocket.class);
if (Rocket != null)
Greenfoot.stop();
return;
Actor Bullet = getOneIntersectingObject(Bullet.class); //This line here- unreachable???
if (Bullet != null)
getWorld().removeObject(Bullet);
return;
}
}


