Ejemplo n.º 1
0
        private void UpdatePerceptions(GameTime gameTime)
        {
            nearestObj = null;
            nearestObj = Game1.getNearestEnemyObject(Game1.controlShip);

            willCollide = false;
            if (nearestObj != null)
            {
                Vector2.Distance(ref nearestObj.position, ref Game1.controlShip.position, out nearestObjDist);
                float adjSafetyRadius = safetyRadius + nearestObj.size;

                if (nearestObjDist <= adjSafetyRadius)
                {
                    willCollide = true;
                }
            }
        }