Пример #1
0
        public void Initialize()
        {
            Minerals.Clear();

            MineralDefinition m;

            m = new MineralDefinition()
            {
                Type = MineralType.Cash10,
                Texture = "cash10",
                TimeAlive = 12000, 
                Value = 10,
                Radius = 12, 
                ParticulesRepresentation = "mineral1",
                Origin = new Vector2(7, 7)
            };
            Minerals.Add(MineralType.Cash10, m);


            m = new MineralDefinition()
            {
                Type = MineralType.Cash25,
                Texture = "cash25",
                TimeAlive = 8000,
                Value = 25,
                Radius = 14,
                ParticulesRepresentation = "mineral2",
                Origin = new Vector2(0, 10)
            };
            Minerals.Add(MineralType.Cash25, m);


            m = new MineralDefinition()
            {
                Type = MineralType.Cash150,
                Texture = "cash150",
                TimeAlive = 4000,
                Value = 150,
                Radius = 14,
                ParticulesRepresentation = "mineral3",
                Origin = new Vector2(0, 12)
            };
            Minerals.Add(MineralType.Cash150, m);


            m = new MineralDefinition()
            {
                Type = MineralType.Life1,
                Texture = "1up",
                TimeAlive = 6000,
                Value = 1,
                Radius = 14,
                ParticulesRepresentation = "mineralPointsVie",
                Origin = new Vector2(15, -5)
            };
            Minerals.Add(MineralType.Life1, m);
        }
        public MineralTakenAnimation(Scene scene, MineralDefinition definition, Vector3 position, double visualPriority)
            : base(1000, visualPriority)
        {
            Value = new Image(definition.Texture, position);

            switch (definition.Type)
            {
                case MineralType.Cash150:
                    Value.SizeX = 2;
                    break;
                case MineralType.Life1:
                    Value.SizeX = 2;
                    break;
            }

            scene.VisualEffects.Add(Value, Core.Visual.VisualEffects.FadeOutTo0(255, 0, 1000));
            scene.PhysicalEffects.Add(Value, Core.Physics.PhysicalEffects.Move(position + new Vector3(0, -100, 0), 0, 1000));
        }