I am recieving a null pointer exception.
java.lang.NullPointerException
at SmoothMover.move(SmoothMover.java:43)
at Supply.act(Supply.java:35)
at greenfoot.core.Simulation.actActor(Simulation.java:568)
at greenfoot.core.Simulation.runOneLoop(Simulation.java:526)
at greenfoot.core.Simulation.runContent(Simulation.java:215)
at greenfoot.core.Simulation.run(Simulation.java:205)
/**
* Act - do whatever the Supply wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
checkPowerUp();
move();
life--;
if(life==0){
getWorld().removeObject(this);
life=1000;
}
} /**
* Move in the current movement direction. Wrap around to the opposite edge of the
* screen if moving out of the world.
*/
public void move()
{
exactX = exactX + movement.getX();
exactY = exactY + movement.getY();
if(exactX >= getWorld().getWidth()) {
exactX = 0;
}
if(exactX < 0) {
exactX = getWorld().getWidth() - 1;
}
if(exactY >= getWorld().getHeight()) {
exactY = 0;
}
if(exactY < 0) {
exactY = getWorld().getHeight() - 1;
}
super.setLocation((int) exactX, (int) exactY);
}

