Hello everyone:
I got a little issue here with my isKeyDown.
It's placed in the World - subclass.
I don't know why, there are no errors but whenever I press 'o', the program won't stop/won't display game-over. Either way, I have one piece of this too in my Actor-subclasses, tried it there as well, didn't work. A classmate had the same problem.
Anyone find the little problem?
1 2 3 4 5 6 7 8 9 10 11 | public Dambord() { // Create a new world with 600x400 cells with a cell size of 1x1 pixels. super ( 500 , 500 , 1 ); SchijvenAdd(); if (Greenfoot.isKeyDown( "o" )) { setBackground( "game-over.jpg" ); Greenfoot.stop(); } } |