Example #1
0
        private void DrawStars(int layer, float deltaTime)
        {
            // Draw the stars.
            for (int i = 0; i < _stars.Length / 4; i++)
            {
                CluwneLib.drawPoint((int)_stars[i, layer].Position.X, (int)_stars[i, layer].Position.Y,
                                    _stars[i, layer].Magnitude);

                // Move the stars down.
                _stars[i, layer].Position.Y += _stars[i, layer].VDelta * deltaTime;

                // Wrap around.
                if (_stars[i, layer].Position.Y > CluwneLib.CurrentClippingViewport.Height)
                {
                    _stars[i, layer].Position =
                        new Vector2f((float)(_random.NextDouble() * CluwneLib.CurrentClippingViewport.Width), 0);
                }
            }
        }