I am using 'SetRotation' move a character up,down,left and right. I am also swapping image each time (so that they 'look' up,down,left and right). However, my images are chagign their orientation. How do I swap image, make the actor move but stop the orientation of the image from changing? Example code I am using below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | move( 2 ); if (Greenfoot.isKeyDown( "right" )) { setRotation( 0 ); setImage(right); } if (Greenfoot.isKeyDown( "down" )) { setRotation( 90 ); setImage(down); } if (Greenfoot.isKeyDown( "left" )) { setRotation( 180 ); setImage(left); } if (Greenfoot.isKeyDown( "up" )) { setRotation( 270 ); setImage(up); } |