Exemplo n.º 1
0
        public static void Play()
        {
            while (isAlive && isPlayble)
            {
                GfxTools.Clean();
                //Input
                if (GfxTools.Win.GetKey(KeyCode.P))
                {
                    Exit();
                }


                player.Input();

                //Update
                Update();
                Background.Update();
                coin.Update();
                AsteroidMng.Update();
                platform.Update();
                player.Update();
                LifeMng.Update();


                //Draw
                Background.Draw();
                coin.Draw();
                AsteroidMng.Draw();
                platform.Draw();
                player.Draw();
                Explosion.Draw();
                scoreText.Draw();
                LifeMng.Draw();
                gui.Draw();


                GfxTools.Win.Blit();
            }
            if (!isAlive && !isPlayble && isSavable)
            {
                SaveData();
            }
        }
Exemplo n.º 2
0
        public static void Play()
        {
            while (window.opened)
            {
                GfxTools.Clean();

                //Input
                if (window.GetKey(KeyCode.Esc))
                {
                    window.opened = false;
                }
                scores.Input();

                //Update
                Background.Update();
                logo.Update();
                cmdPlay.Update();
                cmdCredits.Update();
                cmdScore.Update();
                cmdClose.Update();
                cmdSound.Update();
                Game.Play();
                scores.Update();


                //Draw
                Background.Draw();
                logo.Draw();
                cmdPlay.Draw();
                cmdCredits.Draw();
                cmdScore.Draw();
                cmdSound.Draw();
                scores.Draw();
                credits.Draw();
                cmdClose.Draw();


                window.Blit();
            }
        }