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; }
public void addToDisplayList(GameObject obj) { displayList.Add(obj); }