if(actorcount("BulletP")==0 || BulletP.y>y)//Check if there is no bullet on game
{
if(x+(width/2)<0-(view.width/2) && x+(width/2)>(view.width/2))//Does not make the ship go out of screen
{
    if(x<PShip.x)
    {
        x+=1;
    }
    else if(x>Pship.x)
    {
        x-=1;
    }
}
}
else if(actorcount("BulletP")>0)//Check if there a bullet created
{
if(x+(width/2)<0-(view.width/2) && x+(width/2)>(view.width/2))//Does not make the ship go out of screen
{
    if(x<BulletP.x)
    {
        x-=1;
    }
    else if(x>BulletP.x)
    {
        x+=1;
    }
}
}Users browsing this forum: No registered users and 1 guest