I am making my entry for the Greenfoot dare and if I fire a shot, when said shot gets to the end of the world and removes itself, as it should do, the game pauses as though the main actor has died. Does anyone know why/
Here is the code
Can anyone help?
The DoctorProfessor is out!
move(+3); Actor Car1; Car1 = getOneObjectAtOffset(0, 0, Car1.class); if (Car1 != null) { World world; world = getWorld(); world.removeObject(Car1); } Actor Car2; Car2 = getOneObjectAtOffset(0, 0, Car2.class); if (Car2 != null) { World world; world = getWorld(); world.removeObject(Car2); } Actor Car3; Car3 = getOneObjectAtOffset(0, 0, Car3.class); if (Car3 != null) { World world; world = getWorld(); world.removeObject(Car3); } Actor Ambulance; Ambulance = getOneObjectAtOffset(0, 0, Ambulance.class); if (Ambulance != null) { World world; world = getWorld(); world.removeObject(Ambulance); } int gapX = 10; int gapY =8; if (getX() >= getWorld().getWidth()-gapX || getX() <= gapX || getY() >= getWorld().getHeight()-gapY ||getY() <= gapY) { getWorld().removeObject(this); } Actor Car; Car = getOneObjectAtOffset(0, 0, Car.class); if (Car != null) { World world; world = getWorld(); world.removeObject(Car); }