Пример #1
0
        static void Main()
        {
            var form = new Pong();
            var gs   = new GameState(form.ClientRectangle);

            form.gs = gs;

            var play = new PlayInterface(gs);

            gs.currentInterface = play;
            gs.currentLevel     = new Level(gs, LevelDefs.levels[gs.levelNo]);

            var gitRekt = form.ClientRectangle;

            play.readyBall();

            Timer t = new Timer();

            t.Tick    += form.t_Tick;
            t.Interval = gs.gameSpeed;
            t.Start();

            Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(form);
        }
Пример #2
0
        private void restartGame()
        {
            gs.gameOver   = false;
            gs.levelNo    = 0;
            gs.playerLife = GameState.startPlayerLife;
            var play = new PlayInterface(gs);

            gs.currentInterface = play;
            gs.currentLevel     = new Level(gs, LevelDefs.levels[gs.levelNo]);
            play.readyBall();
        }