コード例 #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
ファイル: Pong.cs プロジェクト: nvlled/pong
        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();
        }