This site requires JavaScript, please enable it in your browser!
Greenfoot back
javanoob
javanoob wrote ...

2013/10/10

i don't know what is wrong with my stage changing.

javanoob javanoob

2013/10/10

#
So below is my code, and whenever World sets to finalevel, error pops out and says cannot find door1, which is in level 1. How do i fix this?
    private void NextLevel()
    {
        if (isTouching(portalout.class)) {
            getWorld().addObject(new boss(), 200, 300);
        }
                    if (isTouching(portal1.class)) {
            getWorld().removeObject(this);
            Greenfoot.setWorld(new finalevel(this));
}
            if (isTouching(door1.class)) {
                getWorld().removeObject(this);
                Greenfoot.setWorld(new level2(this));
  }
}
danpost danpost

2013/10/10

#
Try an 'else if' on line 10.
javanoob javanoob

2013/10/10

#
thx!! it worked!
You need to login to post a reply.