コード例 #1
0
ファイル: Game1.cs プロジェクト: BTKY/SpeedCodingNetworkGame
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            // TODO: Add your update logic here

            _managerNetwork.Update();
            _managerInput.Update(gameTime.ElapsedGameTime.Milliseconds);
            _managerPlayers.Update(gameTime.ElapsedGameTime.Milliseconds);
            _managerEnemies.Update(gameTime.ElapsedGameTime.Milliseconds);
            base.Update(gameTime);
        }
コード例 #2
0
        protected override void Update(GameTime gameTime)
        {
            if (Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            managerMouse.Update();
            managerUnits.Update();
            managerEnemies.Update();
            managerBuildings.Update();
            managerUI.Update();

            managerCombat.Update();

            if (IsActive)
            {
                camera.Update(gameTime);
            }

            base.Update(gameTime);
        }
コード例 #3
0
        public override void Update()
        {
            //if (IsActive)
            Warcraft.camera.Update();

            if (start)
            {
                managerPlayerUnits.Update();
                if (Battleship.move)
                {
                    increment += 1;

                    if (fadeOut < 0.8f)
                    {
                        fadeOut += (float)Math.Pow(1.05, increment) / 100;
                    }

                    if (fadeOut > 0.6)
                    {
                        managerMouse.Update();
                        showSummary = true;
                    }
                }
                else
                {
                    managerMouse.Update();
                    managerPlayerBuildings.Update();
                    managerUI.Update();
                    managerEnemies.Update();

                    managerCombat.Update();
                }
            }
            else
            {
                managerMouse.Update();
            }
        }