Im making a game where aliens shoot that will moving on their own, problem is that everytime i am trying to rotate the bullet class south it wont rotate that way it'll only rotate to NE,E, and NW no matter what number i place in setRotation(); I feel like the movement of the aliens is affecting the bullets direction but i dont know. Heres my bullet class, please help?
public class AlienLaser extends Actor
{
/**
* Act - do whatever the AlienLaser wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
private int speed = 3;
private int point;
private World world;
private boolean unlock = false;
public AlienLaser()
{
GreenfootSound laser = new GreenfootSound("LaserShot8.wav");
laser.setVolume(75);
laser.play();
setRotation(-540);
GreenfootImage images = getImage();
images.scale(images.getWidth()-25 , images.getHeight()-25);
}
public void act()
{
setLocation(getX() + speed , getY());
move(1);
destroy();
if(unlock == false)
{
if (atWorldEdge() == true)
{
getWorld().removeObject(this);
unlock = false;
}
}
}
public boolean atWorldEdge()
{
if(getX() < 20 || getX() > getWorld().getWidth() - 20)
{
return true;
}
if(getY() < 20)
{
return true;
}
else
{
return false;
}
}
public void destroy()
{
Actor ship = getOneIntersectingObject(spaceShip.class);
GreenfootSound explodeAlien = new GreenfootSound("Explode.wav");
explodeAlien.setVolume(75);
if(ship != null)
{
unlock = true;
explodeAlien.play();
getWorld().removeObject(ship);
getWorld().removeObject(this);
}
}
}