So, im having a problem with my code. I have it so that the actor by default faces right, but i need it o face left when i press "left", but it keeps looking side to side
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | public void move() { int y = getY(); int x = getX(); if (Greenfoot.isKeyDown( "Left" ) && canMoveLeft()) x-=STEP; turn ( 180 ); getImage().mirrorVertically(); if (Greenfoot.isKeyDown( "Right" )&& canMoveRight()) x+=STEP; setLocation(x, y); } |