public void ColumnCoords() { var m1 = new MoveableItem(1, 1, 10); var m2 = new MoveableItem(1, 5, 10); var distanceCalc = new DistanceCalculator(); int distance = distanceCalc.distance(m1, m2); Assert.AreEqual(4, distance); }
public void Colliding() { var m1 = new MoveableItem(1, 1, 10); var m2 = new MoveableItem(1, 1, 10); var distanceCalc = new DistanceCalculator(); int distance = distanceCalc.distance(m1, m2); Assert.AreEqual(0, distance); }
public void DefiningTheMs() { var m1 = new MoveableItem(8, 1, 10); var m2 = new MoveableItem(1, 5, 10); var distanceCalc = new DistanceCalculator(); int distance = distanceCalc.distance(m1, m2); Assert.AreEqual(9, distance); }
public void UpdateWithPlayer(Player player) { var calculateDistance = new DistanceCalculator(); var distance = calculateDistance.distance(this._Item, player._Item); if (distance < 4) { _PlayerGotTooClose = true; } if (distance == 0) { _PlayerCollidedWithCollectable = true; player.currentNumberOfCollectedItems += 1; } }