Exemplo n.º 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);
        }
Exemplo n.º 2
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);
        }