Example #1
0
 public static bool MouseOnFish(Cursor cursor, Camera gameCamera, Fish[] fish, int fishAmount)
 {
     BoundingSphere sphere;
     Ray cursorRay = cursor.CalculateCursorRay(gameCamera.ProjectionMatrix, gameCamera.ViewMatrix);
     for (int i = 0; i < fishAmount; i++)
     {
         sphere = fish[i].BoundingSphere;
         sphere.Radius *= GameConstants.EasyAimScale;
         if (RayIntersectsBoundingSphere(cursorRay, sphere))
         {
             cursor.SetOnFishMouseImage();
             return true;
         }
     }
     cursor.SetNormalMouseImage();
     return false;
 }
Example #2
0
 public static bool MouseOnEnemy(Cursor cursor, Camera gameCamera, BaseEnemy[] enemies, int enemiesAmount)
 {
     Ray cursorRay = cursor.CalculateCursorRay(gameCamera.ProjectionMatrix, gameCamera.ViewMatrix);
     BoundingSphere sphere;
     for (int i = 0; i < enemiesAmount; i++)
     {
         //making it easier to aim
         sphere = enemies[i].BoundingSphere;
         //boss is already big
         if (!enemies[i].isBigBoss)
             sphere.Radius *= GameConstants.EasyAimScale;
         if (RayIntersectsBoundingSphere(cursorRay, sphere))
         {
             cursor.SetShootingMouseImage();
             return true;
         }
     }
     cursor.SetNormalMouseImage();
     return false;
 }