I'm trying to kill an orc, by using key is down "space" to remove an orc and use an image when space is clicked. But it is not working.
public void checkSpace()
{
Orc orc = (Orc) getOneIntersectingObject(Orc.class);
if (Greenfoot.isKeyDown("space"))
{
if (orc != null) {
getWorld().removeObject(this);
}
setImage(M1);
}
}
