using KellysMarvelousAdventure.Utilities;
using Otter;

namespace KellysMarvelousAdventure.UI
{
    class SappExplosion : Entity
    {
        private Spritemap<string> _spriteMap;

        public SappExplosion(float x, float y)
        {
            X = x; Y = y;
            SetHitbox(250, 250, (int)Global.Type.SAPPEXPLOSION);
            Collider.X = 200;
            Collider.Y = 100;
            _spriteMap = new Spritemap<string>(Assets.SAPPEXPLOSION, 700, 400);
            _spriteMap.Add("main", new int[] { 0, 1, 2, 3, 4, 5}, new float[] { 10, 10 });
            _spriteMap.Play("main");
            Graphic = _spriteMap;
            SoundManager.PlayRequestedSound("_sappExplosion");
            Layer = -1;
        }
        public override void Update()
        {
            base.Update();
            var cn = Global.PlayerSession.Controller;
            if (_spriteMap.CurrentAnim == "main" && _spriteMap.CurrentFrameIndex == 5)
            {
                RemoveSelf();
            }
        }
        public override void Render()
        {
            base.Render();
            //Collider.Render();
        }
    }
}
