I am creating a game and I added a start button, Then I thought that if the mouse clicks to button instead of pressing enter It would be much better.


1 | private Actor btnStart; |
1 2 | btnStart = new Button( " Start " ); // however you create it addObject(btnStart, getWidth()/ 2 , getHeight()/ 2 ); |
1 | if (Greenfoot.mouseClicked(btnStart) { // etc. |