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

2020/5/26

NEED SOME URGENT HELP

imran.ahmad imran.ahmad

2020/5/26

#
[Disallowed URL] Hi Guys, I need some urgent help. I need to put above image on my program in the beginning. I am able to figure how to start the game. But I am not able to figure out how to open the Help page and exit the game? Can you guys help me out.Need quick response
danpost danpost

2020/5/26

#
imran.ahmad wrote...
I need to put above image on my program in the beginning. I am able to figure how to start the game. But I am not able to figure out how to open the Help page and exit the game? Can you guys help me out.Need quick response
Add an act method to check and respond to possible keys:
public void act()
{
    String key = Greenfoot.getKey();
    if (key == null) return;
    if ("H".equals(key)) gotoHelp(); //  (you will need to create a gotoHelp method)
    if ("S".equals(key)) startGame(); // ( "                                     " )
    if ("E".equals(key)) endGame(); //   ( "                                     " )
}
You need to login to post a reply.