I'm not sure why it would be doing this, please help
import greenfoot.*;
/**
* protagonist actions
*
* @author Spooks
* @version 1.0
*/
public class _hero extends Mover
{
/**
* Act - do whatever the _hero wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
move();
}
/**
* Moving actions
*/
public void move()
{
//moves ship accordingly
if(Greenfoot.isKeyDown("right")){
moveRight();
}
if(Greenfoot.isKeyDown("left")){
moveLeft();
}
if(Greenfoot.isKeyDown("up")){
moveUp();
}
if(Greenfoot.isKeyDown("down")){
moveDown();
}
//speeds up ship if shift is held
if(Greenfoot.isKeyDown("shift")){
boost();
}
if(!Greenfoot.isKeyDown("shift")){
!boost();
}
}
}
if (!atWorldEdge()) // as a condition // or boolean inPlay = !atWorldEdge(); // locally saved value // or even return !atWorldEdge(); // returned value
!atWorldEdge(); // is like true; // a stand-alone boolean value // or 45; // a stand-alone int value // might as well do this ; // an empty statement
if (!atWorldEdge()) // as a condition // or boolean inPlay = !atWorldEdge(); // locally saved value // or even return !atWorldEdge(); // returned value
!atWorldEdge(); // is like true; // a stand-alone boolean value // or 45; // a stand-alone int value // might as well do this ; // an empty statement