Just watched a youtube video on shooting, it told me to copy the mover code but I can't find it anywhere???
/**
* Make an Actor move the given distance.
*
* @param distance
* The distance the Actor is moved.
*/
public void move(double distance) {
double angle = Math.toRadians(getRotation());
int x = (int) Math.round(getX() + Math.cos(angle) * distance);
int y = (int) Math.round(getY() + Math.sin(angle) * distance);
setLocation(x, y);
}
/**
* Make an Actor move the given distance into a given direction.
*
* @param angle
* The angle to which the actor should be moved.
*
* @param distance
* The distance the Actor is moved.
*/
public void move(double angle, double distance) {
angle = Math.toRadians(angle);
setLocation((int) (getX() + Math.cos(angle) * distance), (int) (getY() + Math.sin(angle) * distance));
}