Beispiel #1
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Load shaders
            fxParticles = Content.Load <Effect>("Shaders\\Particles");
            fxParticles.Parameters["Texture"].SetValue(Content.Load <Texture2D>("Textures\\Particle"));

            box = new TransparentBox(GraphicsDevice);

            // load font
            font = Content.Load <SpriteFont>("Fonts\\Debug");

            this.Components.Add(fpsCounter = new FPSCounter(this));


            int pCount = 0;

            // Particles
            particles = new Particles(fxParticles);
            float pOffset = particles.ParticleRadius * 2;
            Color color   = Color.White;

            for (int x = 0; x < 5; x++)
            {
                for (int z = 0; z < 5; z++)
                {
                    for (int y = 0; y < 10; y++)
                    {
                        if (pCount >= 50 && pCount < 100)
                        {
                            color = Color.Red;
                        }
                        else if (pCount >= 100 && pCount < 150)
                        {
                            color = Color.Yellow;
                        }
                        else if (pCount >= 150 && pCount < 200)
                        {
                            color = Color.Green;
                        }
                        else if (pCount >= 200 && pCount < 250)
                        {
                            color = Color.CornflowerBlue;
                        }

                        particles.Add(new Particle(new Vector3(x, y, z) * pOffset, particles.GetRandomVelocity(), color));
                        pCount++;
                    }
                }
            }

            color = Color.Red;
        }
Beispiel #2
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Load shaders
            fxParticles = Content.Load<Effect>("Shaders\\Particles");
            fxParticles.Parameters["Texture"].SetValue(Content.Load<Texture2D>("Textures\\Particle"));

            box = new TransparentBox(GraphicsDevice);

            // load font
            font = Content.Load<SpriteFont>("Fonts\\Debug");

            this.Components.Add(fpsCounter = new FPSCounter(this));

            int pCount = 0;
            // Particles
            particles = new Particles(fxParticles);
            float pOffset = particles.ParticleRadius * 2;
            Color color = Color.White;
            for (int x = 0; x < 5; x++)
            {
                for (int z = 0; z < 5; z++)
                {
                    for (int y = 0; y < 10; y++)
                    {
                        if (pCount >= 50 && pCount < 100)
                            color = Color.Red;
                        else if (pCount >= 100 && pCount < 150)
                            color = Color.Yellow;
                        else if (pCount >= 150 && pCount < 200)
                            color = Color.Green;
                        else if(pCount >= 200 && pCount < 250)
                            color = Color.CornflowerBlue;

                        particles.Add(new Particle(new Vector3(x, y, z) * pOffset, particles.GetRandomVelocity(), color));
                        pCount++;
                    }
                }
            }

            color = Color.Red;
        }