예제 #1
0
        public void SetGameLoop(GameLoop gameLoop)
        {
            if (this.gameLoop != null)
            {
                this.gameLoop.Update -= GameLoopOnUpdate;
            }

            this.gameLoop = gameLoop;

            if (this.gameLoop != null)
            {
                this.gameLoop.Update += GameLoopOnUpdate;
            }
        }
예제 #2
0
        void OnLoaded(object sender, RoutedEventArgs e)
        {
            Initialize();

            //add border
            int borderWidth = (int)(ScreenHeight * .05f);

            border = new Border(ScreenWidth, ScreenHeight, borderWidth, ScreenCenter);
            border.Load(this, physicsSimulator);

            GameLoop loop = new GameLoop();

            SetGameLoop(loop);
            loop.Start();
        }