using KellysMarvelousAdventure.entities;
using Otter;

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

        public ActualSapBomb(float x, float y)
        {
            X = x; Y = y;
            _spriteMap = new Spritemap<string>(Assets.ACTUALSAPPBOMB, 32, 24);
            _spriteMap.Add("main", new int[] { 0 }, new float[] { 3, 3 });
            _spriteMap.Play("main");
            Graphic = _spriteMap;
            Layer = -1;
        }
        public override void Update()
        {
            base.Update();
            X = Scene.MouseX;
            Y = Scene.MouseY;
            var cn = Global.PlayerSession.Controller;
            if (cn.Button("LeftMouseClick").Pressed)
            {
                //Scene.Add(new CatShipSpawner(X, Y));
                Scene.Add(new SappExplosion(X-350, Y-200));
                RemoveSelf();
            }
        }
    }
}
