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

2017/3/26

Need more help with select levels

Zappib Zappib

2017/3/26

#
So I have a thing in my green-foot game that allows to select levels and I have multiple pages to I have multiple worlds for each page. every world have
if(Greenfoot.isKeyDown("right"))
            Greenfoot.setWorld(new LevelSelectMenu2());
but level 2 has new LeveSelectMenu3 and so on. when ever I press down the right arrow key it will skip level pages, I know because when I have the key pressed it goes onto the nest world and it notices that I have the right arrow key down so it goes to the next page. can someone help me so when ever I press the right arrow key it goes to the next page instead of another page. sorry if this did not make sense.
danpost danpost

2017/3/26

#
Use:
if ("right".equals(Greenfoot.getKey()))
Just do not use 'getKey' for anything else.
Zappib Zappib

2017/3/26

#
danpost wrote...
Use:
if ("right".equals(Greenfoot.getKey()))
Just do not use 'getKey' for anything else.
I will try that out and I have another question, how do you make a scrolling world for a top down game?
danpost danpost

2017/3/26

#
Zappib wrote...
how do you make a scrolling world for a top down game?
Please see my Scrolling Tutorial scenario.
You need to login to post a reply.