Example #1
0
        public void CameraManager_Focus_Vector2_PositionShouldMatch()
        {
            Assert.AreEqual(0.0f, _camera.Position.X);
            Assert.AreEqual(0.0f, _camera.Position.Y);

            var position = new Vector2(50.0f, 30.0f);

            _camera.Focus(position);

            Assert.AreEqual(-590.0f, _camera.Position.X);
            Assert.AreEqual(-330.0f, _camera.Position.Y);

            _camera.Position = new Vector2(0.0f, 0.0f);
        }
Example #2
0
        public override void Process()
        {
            Entity player = (Entity)BlackBoard.GetEntry("Player");

            if (player == null)
            {
                return;
            }

            Position position = player.GetComponent <Position>();

            _cameraManager.Focus(position.X, position.Y + 30);
        }