Beispiel #1
0
        private void DrawRecursive(IList <GameObject> layer)
        {
            for (int x = 0; x < layer.Count; x++)
            {
                GameObject node = layer[x];

                if (node.Visible)
                {
                    BoundingBox nodeBox = node.DrawBounds();
                    if (nodeBox.Intersects(Camera.ViewportBounds))
                    {
                        node.Draw(_SpriteBatch);
                        DrawRecursive(node.Children);
                    }
                    else
                    {
                        ++NodesCulled;
                    }
                }
            }
        }