Beispiel #1
0
        protected override void OnRenderFrame(FrameEventArgs e)
        {
            base.OnRenderFrame(e);

            GL.Clear(ClearBufferMask.ColorBufferBit);
            GL.ClearColor(Color.Purple);

            foreach (LevelObject lo in level.levelObjects)
            {
                if (lo.type.Equals(ObjectType.Background))
                {
                    lo.Draw();
                }
            }

            localPlayer.Draw();

            foreach (LevelObject lo in level.levelObjects)
            {
                if (lo.type.Equals(ObjectType.Normal))
                {
                    lo.Draw();
                }
            }

            foreach (AbstractEntity entity in level.entities)
            {
                if (!entity.controlable)
                {
                    entity.Draw();
                }
            }

            foreach (LevelObject lo in level.levelObjects)
            {
                if (lo.type.Equals(ObjectType.Foreground))
                {
                    lo.Draw();
                }
            }


            SwapBuffers();
        }