public void Move(MovementDirectionEnum movementDirection) { //BAT //Define Behavior System.Windows.Point batLocation = _imageManager.GetImageLocation(EnemyImage); BehaviorPropertiesModel behaviorPropertiesModel = new BehaviorPropertiesModel() { EnemyName = EnemyName, MovementDirection = movementDirection, Target = _playerLocationPoint, Chaser = batLocation, }; var behavioralDirection = _selectedBehavior.ApplyBehavior(behaviorPropertiesModel); //Confirm Castle Wall Boundaries reached var _imageObjectShapeModel = _castle.GetCanvasLocationAndDimensionsOuterLimits(); var castleSideWallBoundaryReached = _imageManager.ImageIsBeyondBoundaries_Adaptor(_imageObjectShapeModel, EnemyImage); var selectedMovementDirection = (castleSideWallBoundaryReached == MovementDirectionEnum.MovementClear_NoBoundariesReached) ? behavioralDirection :_movementDirectionManager.GetOppositeDirection(castleSideWallBoundaryReached); //Set Movement MovementDirection = selectedMovementDirection; //Process Movement System.Drawing.Point newLocationPoint = _movementStrategy.GetMovement(MovementDirection); System.Drawing.Point newSpeedLocationPoint = _imageManager.ModifyLocationPointValues(newLocationPoint, _speedMovement); _imageManager.SetNewLocationImage(EnemyImage, newSpeedLocationPoint); }
public void PlayerMove(MovementDirectionEnum movementDirection) { //HERO //Define Behavior //Confirm Castle Wall Boundaries reached var castleInnerLimits = _castle.GetCanvasLocationAndDimensionsInnerLimits(); MovementDirectionEnum castleWallReachedByPlayer = _imageManager.ImageIsBeyondBoundaries_Adaptor(castleInnerLimits, ShooterImage); //Process Movement var selectedMovement = (castleWallReachedByPlayer != MovementDirectionEnum.MovementClear_NoBoundariesReached) ? _movementDirectionManager.GetOppositeDirection(castleWallReachedByPlayer) : movementDirection; ProcessPlayerMovement(selectedMovement); }