Can someone show me a line for flipping an image when a is pressed, I designed a helicopter but when i have it rotate the other way, its upside down. Someone show me a line or example I would use, thats the easiest way I learn.


1 2 3 | GreenfootImage img = getImage(); img.mirrorVertically(); setImage(img); |
1 | getImage().mirrorVertically(); |
1 2 3 4 5 6 7 8 9 10 11 | if (Greenfoot.isKeyDown( "a" ) && !isDown) { /** *insert method for flipping picture **/ isDown = true ; } if (!Greenfoot.isKeyDown( "a" ) && isDown) { isDown = false ; } |
1 | if ( "a" .equals(Greenfoot.getKey()) |
1 2 3 4 5 6 | if ( "a" .equals(Greenfoot.getKey()) { turn( 180 ); getImage().mirrorVertically(); // this last line gets the current image and 'flips' it } |