package com.ady.timerunner;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;

/**
 * Created by ADY on 27.1.2018.
 */

public class PowerUp {
    private Sprite sprite;
    private float height;
    private float angle;
    public float worldradius=1f;
    private Vector2 center;
    public int type;
    public Vector2 position = new Vector2(5, 5);

    public PowerUp(World world, float angle, float height, int type, Texture text) {
        this.type=type;
        this.angle = angle;
        this.height=height;
        sprite=new Sprite(text);

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

    public void act()
    {
        angle += 0.3f;
        position = center.cpy().add(MathUtils.cosDeg(angle) * (worldradius +height+64), MathUtils.sinDeg(angle) * (worldradius +height+64));

    }


}
