public void PlayerCantMoveToNegativeSpace() { _localPlayer.Value.Position = new Point(0, 0); var keyCode = 65; PlayerInput.ProcessPlayerKeyboardInput(keyCode, true); HeartBeat.PhysicsLoop(); CharacterFactory.GetLocalPlayerCharacter().Destination.X.Should().Be(0); }
public void PressingWMovesLocalPlayerUp() { _localPlayer.Value.Position = new Point(0, 10); var keyCode = 87; PlayerInput.ProcessPlayerKeyboardInput(keyCode, true); HeartBeat.PhysicsLoop(); CharacterFactory.GetLocalPlayerCharacter().Destination.Y.Should().Be(11); }
public void WillStopWhenReachingDestination() { _localPlayer.Value.Position = new Point(17, 17); _localPlayer.Value.Destination = new Point(17, 17); HeartBeat.PhysicsLoop(); _localPlayer.Value.Position.X.Should().Be(17); _localPlayer.Value.Position.Y.Should().Be(17); }
public void EntityWithDestinationMovesTowardIt() { _localPlayer.Value.Speed = 1; _localPlayer.Value.Position = new Point(0, 0); _localPlayer.Value.Destination = new Point(1, 0); HeartBeat.PhysicsLoop(); _localPlayer.Value.Position.X.Should().Be(1); }
public void EntityDoesNotMoveIfDestinationIsPosition() { _localPlayer.Value.Speed = 200; _localPlayer.Value.Position = new Point(13, 12); _localPlayer.Value.Destination = new Point(13, 12); HeartBeat.PhysicsLoop(); _localPlayer.Value.Position.X.Should().Be(13); _localPlayer.Value.Position.Y.Should().Be(12); }
public void EntityMovesToDestinationOnTwoDifferentAxes() { _localPlayer.Value.Speed = 4; _localPlayer.Value.Position = new Point(5, 4); _localPlayer.Value.Destination = new Point(7, 0); HeartBeat.PhysicsLoop(); _localPlayer.Value.Position.X.Should().Be(6); _localPlayer.Value.Position.Y.Should().Be(1); }
public void EntityMovesTowardDestinationBehind() { _localPlayer.Value.Speed = 3; _localPlayer.Value.Position = new Point(10, 3); _localPlayer.Value.Destination = new Point(1, 3); HeartBeat.PhysicsLoop(); _localPlayer.Value.Position.X.Should().Be(7); _localPlayer.Value.Position.Y.Should().Be(3); }
public void PlayerMovesFromZeroPosition() { _localPlayer.Value.Position = new Point(0, 0); var keyCode = 68; PlayerInput.ProcessPlayerKeyboardInput(keyCode, true); HeartBeat.PhysicsLoop(); HeartBeat.PhysicsLoop(); CharacterFactory.GetLocalPlayerCharacter().Destination.X.Should().Be(2); }
public void KeepingAPressedContinuesMovingPlayerLeft() { _localPlayer.Value.Position = new Point(5, 0); var keyCode = 65; PlayerInput.ProcessPlayerKeyboardInput(keyCode, true); HeartBeat.PhysicsLoop(); HeartBeat.PhysicsLoop(); CharacterFactory.GetLocalPlayerCharacter().Destination.X.Should().Be(3); }
public void ReleasingSStopsMovingDown() { _localPlayer.Value.Position = new Point(5, 10); var keyCode = 83; PlayerInput.ProcessPlayerKeyboardInput(keyCode, true); HeartBeat.PhysicsLoop(); PlayerInput.ProcessPlayerKeyboardInput(keyCode, false); HeartBeat.PhysicsLoop(); CharacterFactory.GetLocalPlayerCharacter().Destination.Y.Should().Be(9); }