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

2014/2/6

Bug in my "new Level" code (Player Class)

askgriff askgriff

2014/2/6

#
Hi Greenfooters! Okay, I have managed to get my platformer working with levels -- but it will advance to level two and keep advancing to level two instead of moving on. I know it's something simple that I'm missing. Anybody know?
  • Player Collects the Key
  • Player Uses Key on Door
  • Unlocking Door Moves to Next Level
  • You can check out my code here: http://www.greenfoot.org/scenarios/10593
    erdelf erdelf

    2014/2/6

    #
    make the world variable static and it should work
    danpost danpost

    2014/2/7

    #
    Setting the field to 'static' would work; but, only the first time in a session. After advancing level(s), the only way to restart back at level one would be to reload the scenario (resetting would not be enough).
    askgriff askgriff

    2014/2/7

    #
    Thanks danpost -- that is the problem I'm having since making it static.
    You need to login to post a reply.