You can see above the bullet is not moving correctly
Here is my code in the head class
public class Head extends Shooter
{
public boolean isGrabbed;
/**
* Act - do whatever the Head wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
grab();
setRotation(((Actor) getWorld().getObjects(Slider.class).get(0)).getRotation());
if(Greenfoot.mouseClicked(this))
{
Bullet peluru = new Bullet();
getWorld().addObject(peluru,getX(),getY());
peluru.setRotation(((Actor) getWorld().getObjects(Head.class).get(0)).getRotation());
peluru.setImage("bullet3.png");
}
// Add your action code here.
}
}public class Bullet extends Actor
{
/**
* Act - do whatever the Bullet wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
move(2);
if(this.isAtEdge())
getWorld().removeObject(this);
//System.out.println(getRotation());
// Add your action code here.
}
}

