public void dodgeAsteroid(){
        //tries to avoid an asteroid before hitting it
        for(int b=0;b<objects.size();b++){
            if(objects.get(b).kind!=0)
                continue;
            if(!objects.get(b).isInMap())
                continue;

            boolean obstacle = collisionCircle((int)(x+vx),(int)(y+vy),h/2+20,(int)(objects.get(b).x),(int)(objects.get(b).y),(int)(objects.get(b).h/2));
            if(obstacle) {
                double angle2=angle-angleBetween(b);


                if(compareAngle(angle,angle2))
                    setAngle(angle+Math.toRadians(3)*power);
                else
                    setAngle(angle-Math.toRadians(3)*power);
                //angle+=angleBetween(b); //obstacle;//Math.toRadians(3)*power;

            } else {
                obstacle = collisionCircle((int)(x+vx),(int)(y+vy),h/2+40,(int)(objects.get(b).x),(int)(objects.get(b).y),(int)(objects.get(b).h/2));
                if(obstacle) {
                    double angle2=angle-angleBetween(b);


                    if(compareAngle(angle,angle2))
                        setAngle(angle+Math.toRadians(2)*power);
                    else
                        setAngle(angle-Math.toRadians(2)*power);
                    //angle+=angleBetween(b); //obstacle;//Math.toRadians(3)*power;

                } else{
                    obstacle = collisionCircle((int)(x+vx),(int)(y+vy),h/2+80,(int)(objects.get(b).x),(int)(objects.get(b).y),(int)(objects.get(b).h/2));
                    if(obstacle) {
                        double angle2=angle-angleBetween(b);


                        if(compareAngle(angle,angle2))
                            setAngle(angle+Math.toRadians(1)*power);
                        else
                            setAngle(angle-Math.toRadians(1)*power);
                        //angle+=angleBetween(b); //obstacle;//Math.toRadians(3)*power;

                    }
                }


            }
        }
    }