Ejemplo n.º 1
0
        private void UpdateParticle(float elapsedTime, SplitterParticle particle)
        {
            if (!particle.IsAlive)
            {
                return;
            }

            particle.Update(elapsedTime);
        }
Ejemplo n.º 2
0
        public SplitterSystem(Vector2 startPosition, float particleRadius)
        {
            rand = new Random();

            particles = new SplitterParticle[100];

            for (int i = 0; i < 100; i++)
            {
                particles[i] = new SplitterParticle(startPosition, GetRandomDirection(), particleRadius);
            }
        }
Ejemplo n.º 3
0
        private void DrawParticle(SpriteBatch spriteBatch, SplitterParticle particle)
        {
            Color color = new Color(particle.AlphaValue, particle.AlphaValue, particle.AlphaValue, particle.AlphaValue);

            DestinationRectangle =
            new Rectangle(Camera.TransformX(particle.Position.X - particle.Radius)
                , (int)Camera.TransformY(particle.Position.Y - particle.Radius)
                , Camera.TransformSizeX(particle.Width)
                , Camera.TransformSizeY(particle.Height));

            spriteBatch.Draw(GameObjectTexture, DestinationRectangle, color);
        }