コード例 #1
0
        protected override void Initialize()
        {
            try
            {
                base.Initialize();

                OnInitialize();

                screens = new ScreenManager(this);

                OnAfterInitialize();
            }
            catch (Exception e)
            {
                SAMLog.FatalError("Game::Initialize", e);
            }
        }
コード例 #2
0
        protected MonoSAMGame()
        {
            try
            {
                FileHelper.RegisterSystemSecificHandler(StaticBridge.FileHelper);

                Bridge      = StaticBridge;
                CurrentInst = this;

                CurrentTime = new SAMTime();

                Graphics = new GraphicsDeviceManager(this);
                Content.RootDirectory = "Content";

                CultureInfo.DefaultThreadCurrentCulture   = CultureInfo.InvariantCulture;
                CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture;
            }
            catch (Exception e)
            {
                SAMLog.FatalError("Game::Constructor", e);
            }
        }
コード例 #3
0
        protected override void Draw(GameTime gameTime)
        {
            try
            {
                var time = new SAMTime(gameTime);

                GameCycleCounter++;
                CurrentTime = time;

                screens.Draw(time);

                base.Draw(gameTime);

                if (IsInitializationLag)
                {
                    UpdateInitLag(gameTime);
                }
            }
            catch (Exception e)
            {
                SAMLog.FatalError("Game::Draw", e);
            }
        }
コード例 #4
0
        protected override void Update(GameTime gameTime)
        {
            try
            {
                var time = new SAMTime(gameTime);

                UpdateAgents(time);

                OnUpdate(time);

                screens.Update(time);

                Sound.Update(time);

                gameDispatcher.Work();

                base.Update(gameTime);
            }
            catch (Exception e)
            {
                SAMLog.FatalError("Game::Update", e);
            }
        }