package com.ady.timerunner;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.math.Circle;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.graphics.Color;
/**
 * Created by ADY on 26.1.2018.
 */

public class Block {

    public float height;
    public Vector2 center;
    public Vector2 position;
    public float worldradius;
    public float angle;
    Color color=new Color(Color.NAVY);
    Circle body=new Circle();
    public boolean dead=false;

    public Block(World world, float angle, float height) {

        this.angle = angle;
        this.height=height;
        center = world.center;
        worldradius = world.size / 2f;
        position = center.cpy().add(MathUtils.cosDeg(this.angle) * (worldradius +this.height+64), MathUtils.sinDeg(this.angle) * (worldradius +this.height+64));
        body.set(position.x+64,position.y+64,48);
    }

    public void act() {
        angle += 0.3f;
        position = center.cpy().add(MathUtils.cosDeg(angle) * (worldradius +height+64), MathUtils.sinDeg(angle) * (worldradius +height+64));
        Vector2 adder=new Vector2(5,5);
        adder.setLength(64);
        adder.setAngle(angle);
        adder.add(position);
        body.set(adder.x,adder.y,50);

    }
}
