@Proprogrammer04
Yeah, I really tried.
But for it to work you would have to test for ANY key minus the right key was pressed.
This sensing for any key is a problem I saw many times while I was searching for a solution.
I couldn't get it to work.
If you know how to do this, just leave a reply.
This also was for a school project, therefore, I had only limited time on my hand.
Something along these lines could work:
-------
String key = Greenfoot.getKey();
if (key != null) //any key was pressed
{
if (correctKey.equals(key))
{
//correct key was pressed
}
else
{
//any other key was pressed
}
}
-------
You might consider adding Greenfoot.start() at the end of the constructor of the world; that'll make the scenario start automatically (no more need to press the 'Run' button). Since you've got a menu and a start button implemented, Greenfoot's built in 'Run' button is unnecessary for you.
Also, 70 :P
2019/6/27
2019/6/27
2019/6/27
2019/6/27
2019/7/14
2019/7/14
2019/7/14
2019/7/26
2019/7/26
2019/7/26
2019/8/2
2019/8/5
2019/8/6
2019/8/8
2019/8/8
2019/8/19
2019/10/13
2019/11/5
2020/2/5
2020/2/27
2020/6/17