Exemplo n.º 1
0
 bool isAlone(Bonus bonus)
 {
     for (int i = 0; i < smile.allSmiles.Count(); i++)
     {
         if (isCollision(bonus, smile.allSmiles[i]))
             return false;
     }
     return true;
 }
Exemplo n.º 2
0
        public bool isCollision(Bonus bonus, Smile currSmile)
        {
            int deltaX = (int)Math.Abs(bonus.Position.X - currSmile.Position.X);
            int deltaY = (int)Math.Abs(bonus.Position.Y - currSmile.Position.Y);

            if (Math.Sqrt(deltaX * deltaX + deltaY * deltaY) <= sizeOfSmile) return true;
            return false;
        }