Esempio n. 1
0
        //add an ore drop using a gameobject's positional/velocity properties
        public static void AddOreDrop(GameObject origin)
        {
            Particle temp = new Particle( //generate the ore drop
               ContentHandler.Textures[ORE_KEY],
               origin.WorldCenter,
               origin.Velocity +
               Vector2.Multiply(AsteroidManager.GetVelocity(origin.Rotation + MathHelper.ToRadians(Util.rnd.Next(-90, 90))), 0.5f),
               Color.White,
               ORE_DROP_FTL,
               true,
               origin.Rotation,
               (float)Util.rnd.NextDouble(-0.1f, 0.1f),
               1f, 1f, SpriteEffects.None,
               ContentHandler.Textures[ORE_KEY].GetMeanRadius(8),
               0, 0, 8, 1, 8, 0, false, ORE_FRAME_DELAY);
            temp.Animating = true;

            OreDrops.Add(temp);
        }
Esempio n. 2
0
        static void addOrePickupEffect(Particle ore)
        {
            ParticleEmitter temp = new ParticleEmitter(
                ORE_EFFECT_PARTICLES,
                ore.WorldCenter,
                OreEffectTextures,
                ORE_PICKUP_COLORS.ToList<Color>(),
                ORE_EFFECT_FTL,
                true,
                true,
                PARTICLE_TIME_TO_EMIT,
                ORE_EFFECT_PARTICLES,
                ORE_EFFECT_EJECTION_SPEED,
                PARTICLERANDOMIZATION,
                0f, ParticleEmitter.EXPLOSIONSPRAY);

            emitters.Add(temp);
        }