示例#1
0
        static void Main(string[] args)
        {
            game = new SpaceInvaders();

            // create update thread
            Thread inputthread = new Thread(InputThread);

            inputthread.Start();

            // alien update thread
            // Thread alienthread = new Thread(AlienThread);
            // alienthread.Start();

            // game loop
            while (true)
            {
                Thread.Sleep(200);

                // update the game
                game.Update();

                // draw the game
                game.Draw();
            }

            // when the game is done.
            // inputthread.Abort();
        }
示例#2
0
        static void Main(string[] args)
        {
            game = new SpaceInvaders();
            Thread inputThread = new Thread(InputThread);

            inputThread.Start();

            while (true)
            {
                Thread.Sleep(200);
                game.Update();
                game.Draw();
            }
        }