public void shoot()
{
MouseInfo mouse=Greenfoot.getMouseInfo();
if(Greenfoot.mousePressed(null))
{
Bullet newBullet;
newBullet = new Bullet();
World world;
world = getWorld();
int z = getRotation();
int x = getX() + 67;
int y = getY() + 14;
world.addObject(newBullet, x, y);
}
}
It may be sufficient just to add the following one line after the world.addObject line:
newBullet.setRotation(z);
However, I cannot say whether the gun's rotation is the same as the player's. If they are different, then more Player1 code needs supplied (the entire class preferably -- otherwise this could take a while). Or, maybe you can figure out what to replace z with to make it the rotation of the gun.