Example #1
0
        public void AddBlood(BloodType type, Vector2 position, Vector2 direction, Color4ub?color = null)
        {
            //Eclaboussure
            Blood blood = null;

            switch (type)
            {
            case BloodType.A:
                blood = new Blood1();
                break;

            case BloodType.B:
                blood = new Blood2();
                break;

            case BloodType.C:
                blood = new Blood3();
                break;

            case BloodType.D:
                blood = new Blood4();
                break;
            }

            blood.SetPosition(position);
            blood.SetDirection(direction);
            blood.SetColor(color);
            AddBlood(blood);

            //Sang sur le sol
            blood = new BloodFloor1();
            blood.SetPosition(position);
            var angle = (float)Math.Atan2(direction.Y, direction.X);

            blood.SetDirection(angle + (float)((RandomGenerator.Instance.Random.NextDouble() * 2) - 1));
            blood.SetColor(color);
            AddStaticBlood(blood);
        }
Example #2
0
 public void AddStaticBlood(Blood blood)
 {
     blood.SetSprite(m_staticRenderer);
 }
Example #3
0
 public void AddBlood(Blood blood)
 {
     blood.SetSprite(m_renderer);
     Bloods.Add(blood);
 }
Example #4
0
 public void AddBlood(Blood blood)
 {
     blood.SetSprite(m_renderer);
     Bloods.Add(blood);
 }
Example #5
0
 public void AddStaticBlood(Blood blood)
 {
     blood.SetSprite(m_staticRenderer);
 }
Example #6
0
        public void Update(TimeSpan elapsed)
        {
            if (m_life.IsAlive)
            {
                m_move.Update(elapsed);

                //if (NeedMove)
                //{
                //    m_location.SetPosition(m_move.NewLocation);
                //    NeedMove = false;
                //}

                var sequence = GetSpriteSequence();

                if (sequence != m_currentSequence)
                {
                    m_currentSequence = sequence;
                    m_currentSequence.Reset();
                }

                m_currentSequence.Update(elapsed);

                if (m_weapon != null)
                {
                    m_weapon.Update(elapsed);
                }
            }
            else if(m_blood == null)
            {
                m_blood = new Blood3();
                m_blood.SetPosition(m_location.Position);
                m_blood.SetColor(new Color4ub(255, 0, 50, 255));
                m_blood.NeverDie = true;
                BloodManager.Instance.AddBlood(m_blood);
            }
        }