Beispiel #1
0
        public void Move(float deltaTime)
        {
            var delta     = Destination - Position;
            var wayLength = MathModule.Length(delta);

            if (wayLength < 0.01)
            {
                return;
            }
            if (wayLength < _speed)
            {
                Position = Destination;
            }
            else
            {
                var move = delta * (float)(_speed / wayLength) * deltaTime;
                Position += move;
            }
        }
Beispiel #2
0
 public bool PointVisible(double x, double y) =>
 MathModule.Hypot(this.Position.X - x, this.Position.Y - y) < this._viewRadius;
Beispiel #3
0
        public bool AbleToFire(Vector2f target)
        {
            var distance = MathModule.Length(target - Position);

            return((distance > _minRange) && (distance < _maxRange));
        }