private void OnTick()
 {
     foreach (var asteroid in _asteroids)
     {
         asteroid.Tick();
         WrapBounds2DSystem.ProcessMove(asteroid, _spaceBounds);
     }
 }
Example #2
0
            public void wraps_negative_x_and_y()
            {
                var startPosition = new Vector3(_worldBounds.min.x - halfSize - 1f, _worldBounds.min.y - halfSize - 1f, 0f);
                var endPosition   = new Vector3(_worldBounds.max.x + halfSize - 1f, _worldBounds.max.y + halfSize - 1f, 0f);

                _wrapper.Position.Returns(startPosition);
                WrapBounds2DSystem.ProcessMove(_wrapper, _worldBounds);
                _wrapper.Received().WrapTo(endPosition);
            }
 private void OnTick()
 {
     for (int i = _bullets.Count - 1; i >= 0; i--)
     {
         _bullets[i].Tick(); // NOTE: Inconsistent updating
         WrapBounds2DSystem.ProcessMove(_bullets[i], _spaceBounds);
         if (!_bullets[i].Active)
         {
             _bullets.RemoveAt(i);
         }
     }
 }
            public void asteroid_wraps_position_when_traveling_positive_on_y()
            {
                var      endPosition = new Vector3(0, -_halfWorldPlusAsteroidSize + 1f, 0);
                Asteroid asteroid    = An.Asteroid.
                                       WithPosition(new Vector3(0, _halfWorldPlusAsteroidSize, 0)).
                                       WithVelocity(new Vector3(0, _velocityMagnitude, 0)).
                                       WithSize(_asteroidSize, _asteroidSize);

                AdvanceOneSecondAndUpdate();

                WrapBounds2DSystem.ProcessMove(asteroid, _worldBounds);
                var distance = Vector3.Distance(endPosition, asteroid.Position);

                Assert.AreEqual(0f, distance, _distanceTolerance);
            }
Example #5
0
 private void Update()
 {
     _ship.Tick();
     _heading = _ship.Heading;
     WrapBounds2DSystem.ProcessMove(_ship as IWrapInBounds, _bounds);
 }