Esempio n. 1
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="e">Provides a snapshot of timing values.</param>
        public override void Render(FrameEventArgs e)
        {
            GL.Viewport(0, 0, sceneManager.Width, sceneManager.Height);
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            systemManager.ActionRenderSystems(entityManager);
        }
Esempio n. 2
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="e">Provides a snapshot of timing values.</param>
        public override void Render(FrameEventArgs e)
        {
            GL.Viewport(0, 0, sceneManager.Width, sceneManager.Height);
            GL.Enable(EnableCap.DepthTest);

            systemManager.ActionRenderSystems();
            cubemapRender.Render();
            coinsToCollect = map.GetNumberOfCoins();
            lives          = map.GetNumberOfLives();

            if (lives == 0)
            {
                sceneManager.ChangeScene(new GameOverScene(sceneManager));
            }

            if (coinsToCollect == coinsCollected)
            {
                audioManager.Delete(true);
                sceneManager.ChangeScene(new WinScene(sceneManager));
            }

            customRender.Render(map, coinsCollected, score);
        }