using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HumanLikeBattleRobots.Graphic;

namespace HumanLikeBattleRobots.Logic
{
    class Smoke: IFX
    {
        private bool isOver = false;
        private float timer = 0;
        private SmokeSprite sprite = new SmokeSprite(1);

        public Smoke(Vec2f position)
        {
            sprite.Position = position;
            sprite.Angle = GameManager.MainRandom.Next(0, 360);
            GameManager.FX.Add(this);
        }

        public void Proceed(double delta)
        {
            timer += (float)delta;
            sprite.Transparency = 0.25f - timer/4;
            sprite.Scale = 0.5f + timer;
            if (timer >= 1)
                isOver = true;
        }

        public void Draw()
        {
            sprite.Draw();
        }

        public bool IsOver
        {
            get { return isOver; }
        }
    }
}
