I dont know how to do the mouseclicked, the documentation says mouseclicked, but it doesn't work.


1 2 3 | if (Greenfoot.mouseClicked( null )) // true for any click // or if (Greenfoot.mouseClicked( this )) // true if current object is clicked |
1 2 | Actor btnYes = new Button( "Yes" ); Actor btnNo = new Button( "No" ); |
1 2 3 4 5 6 7 8 | if (Greenfoot.mouseClicked(btnYes)) { // some action } if (Greenfoot.mouseClicked(btnNo)) { // some other action } |