Exemplo n.º 1
0
        public override void Update(GameTime gameTime)
        {
            foreach (IEntity entity in _entities)
            {
                entity.Update(gameTime);
            }

            // Perform collisions detection and delegate it
            // entities collision detection

            //for (int i = 0; i < _entities.Count-1; i++)
            //{
            //    _collisionManager.PerformCollisionCheck(_entities[i], _entities[i + 1]);
            //}

            _collisionManager.PerformCollisionCheck(player1, ball);
            _collisionManager.PerformCollisionCheck(player2, ball);
        }
Exemplo n.º 2
0
        public override void Update(GameTime gameTime)
        {
            //camera.Focus = ball as IFocusable;

            foreach (IEntity entity in _entities)
            {
                entity.Update(gameTime);
            }

            // Perform collisions detection and delegate it
            // entities collision detection

            //for (int i = 0; i < _entities.Count-1; i++)
            //{
            //    _collisionManager.PerformCollisionCheck(_entities[i], _entities[i + 1]);
            //}

            CollisionManager.PerformCollisionCheck(ball, player1);
            CollisionManager.PerformCollisionCheck(ball, player2);
        }