package com.ady.timerunner;

import com.badlogic.gdx.math.Circle;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;

/**
 * Created by ADY on 28.1.2018. cCc
 */

public class Cloud {
    public int type;
    public float height;
    public Vector2 center;
    public Vector2 position;
    public float worldradius;
    public World world;
    public float angle;
    public float alpha=MathUtils.random(0.7f,0.9f);
    public float speed=MathUtils.random(0.01f,0.06f);



    Circle body = new Circle(5,5,5);


    public Cloud(World world, float angle, float height, int type, float alpha, float speed)
    {
        this.alpha=alpha;
        this.speed=speed;
        this.type=type;
        this.angle = angle -1.5f;
        this.height = height;
        this.world=world;
        center = world.center;
        worldradius = world.size / 2f;
        position = center.cpy().add(MathUtils.cosDeg(this.angle) * (worldradius + 50 + height), MathUtils.sinDeg(this.angle) * (worldradius + 50 + height));
        body.set(position.x+25,position.y+25,20);

    }



    public void act()
    {
        angle-=speed;
        if(MathUtils.randomBoolean(0.001f))
        {
            speed=MathUtils.random(0.01f,0.08f);
        }
        position = center.cpy().add(MathUtils.cosDeg(angle) * (worldradius  + height +50), MathUtils.sinDeg(angle) * (worldradius  + height +50));
    }
}
