using LOoSE_sLOTS.UI;
using LOoSE_sLOTS.Utilities;
using Otter;
using System;

namespace LOoSE_sLOTS.entities
{
    class SlotMachineMenu : Entity
    {
        private Spritemap<string> _spriteMap;
        private float faster = 0;
        private float dedicatedSpeed = Rand.Float(2, 10);

        public SlotMachineMenu(float x, float y)
        {
            X = x; Y = y;
            X = x; Y = y;
            SetHitbox(20, 40, (int)Global.Type.SLOTMACHINE);
            Collider.X = -10;
            Collider.Y = -20;
            _spriteMap = new Spritemap<string>(Assets.SLOTMACHINE, 50, 50);
            _spriteMap.Add("dead", new int[] { 5 }, new float[] { 7f, 7f });
            _spriteMap.Add("on", new int[] { 0, 1 }, new float[] { 7f, 7f });
            _spriteMap.Add("dying", new int[] { 2, 3, 4 }, new float[] { 3f, 3f });
            _spriteMap.Play("on");
            _spriteMap.CenterOrigin();
            Layer = 2;
            Graphic = _spriteMap;
        }

        public override void Update()
        {
            base.Update();
            Y += 5 + faster;
            if (faster < dedicatedSpeed)
            {
                faster += Rand.Float(.2f, .5f);
            }
            if (Y >= Global.MH + 50)
                Y = -50;
        }//end update

        public void Destroy()
        {
            RemoveSelf();
        }

        public override void Render()
        {
            base.Render();
        }
    }
}


