Esempio n. 1
0
 public static bool checkCollision(GameObject obj1, GameObject obj2)
 {
     if (obj2.isActive && obj1.isActive)
     {
         if (Math.Abs(obj1.Y - obj2.Y) < ((obj1.ScaledHeight + obj2.ScaledHeight) / 2.0))
         {
             if (Math.Abs(obj1.X - obj2.X) < ((obj1.ScaledWidth + obj2.ScaledWidth) / 2.0))
             {
                 return true;
             }
         }
     }
     return false;
 }
Esempio n. 2
0
 public void addToDisplayList(GameObject obj)
 {
     displayList.Add(obj);
 }