Exemplo n.º 1
0
        /// <summary>
        /// Called once per/frame, this is the main body for the game logic.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            // Update members //

            // Move camera to 'Focus' position.
            Camera.Update(gameTime);

            // Used for animated tiles. //Not needed yet.
            //TileMap.Update(gameTime);

            // Step the physics simulation, collisions etc.
            PhysicsWorld.UpdateStep(gameTime.ToDeltaTime());

            // Read/send network packets, firing events where needed.
            ClientNetworkManager.Update();



            // Perform update for all players, including local player.
            foreach (var player in Player.AllPlayers)
            {
                player.UpdatePlayer(gameTime);
            }



            //Update Xna base game.
            base.Update(gameTime);
        }
Exemplo n.º 2
0
        /// <summary>Represents Unitys Update method</summary>
        protected override void Update()
        {
            if (_server == null || _client == null)
            {
                return;
            }

            _server.Update();
            _client.Update();
        }