Line 16 is my code that's messed up. I'm pretty sure I have everything else in the world, key, and door class correct but I don't know why line 16 isn't working (I don't have a "nextLevel" thing in any of my other code, and need a response quickly, thanks to whoever helps :D)
import greenfoot.*; // (World, Actor, GreenfootImage, and Greenfoot)
public class Player extends Mover
{
private static final int jumpStrength = 26;
public void act()
{
checkKeys();
checkFall();
Key key = (Key)getOneIntersectingObject(Key.class);
if (key != null) key.encountered();
Door door = (Door)getOneIntersectingObject(Door.class);
if (door != null && door.isOpened()) nextLevel();
}
private void checkKeys()
{
if (Greenfoot.isKeyDown("left") )
{
//setImage("Riley.png");
moveLeft();
}
if (Greenfoot.isKeyDown("right") )
{
// setImage("Riley001.png");
moveRight();
}
if (Greenfoot.isKeyDown("space") )
{
if (onGround())
jump();
}
}
private void jump()
{
setVSpeed(-jumpStrength);
fall();
}
private void checkFall()
{
if (onGround()) {
setVSpeed(0);
}
else {
fall();
}
}
}

