Hey everyone
I have a problem where when my actor is facing to the right it shoots but when my actor is facing to the left it still shoots to the right.
here is my code
'
and this is my bullet code
public void act()
if(isTouching(Flag.class))
{
removeTouching(Flag.class);
World2 lvl1 = new World2();
Greenfoot.setWorld(lvl1);
if(isTouching(coin.class))
{
removeTouching(coin.class);
Greenfoot.playSound("MarioCoin.mp3");
}
if (Greenfoot.isKeyDown("right"))
{
move(8);
marioRight();
marioRight = true;
}
if (Greenfoot.isKeyDown("left"))
{
move(-8);
marioLeft();
marioLeft = true;
}
if("space".equals(Greenfoot.getKey()))
{
fire();
}
bossMode();
}
public void marioRight()
{
frame = frame + 1;
frame = frame % 4;// 0 -1 -2
String switchMario = "MarioSteppingRight"+frame+".png";
setImage(new GreenfootImage(switchMario));
}
public void marioLeft()
{
frame = frame + 1;
frame = frame % 4;// 0 -1 -2
String switchBalloon = "MarioLeft"+frame+".png";
setImage(new GreenfootImage(switchBalloon));
}
private void fire()
{
Bullet bullet = new Bullet();
getWorld().addObject(bullet, getX(), getY());
}public void act()
{
move(30);
World w=getWorld();
if(isTouching(Snake.class))
{
removeTouching(Snake.class);
}
if (atWorldEdge())
{
w.removeObject(this);
}
}
public boolean atWorldEdge()
{
if(getX() < 5 || getX() > getWorld().getWidth() - 5)
return true;
if(getY() < 4 || getY() > getWorld().getHeight() - 5)
return true;
else
return false;
}

