/// <summary> /// Acts as a drawing delegate for DrawObjectWithTransform /// After performing the necessary transformation (translate/rotate) /// DrawObjectWithTransform will invoke this method /// </summary> /// <param name="o">The object to draw</param> /// <param name="e">The PaintEventArgs to access the graphics</param> private void ShipDrawer(object o, PaintEventArgs e) { Ship p = o as Ship; int shipWidth = 35; if (p.GetHealth() == 0) { e.Graphics.DrawImage(dead_ship, -(shipWidth / 2), -(shipWidth / 2), shipWidth, shipWidth); return; } if (p.isThrustOn()) { e.Graphics.DrawImage(shipImagesThrust[p.GetID() % 8], -(shipWidth / 2), -(shipWidth / 2), shipWidth, shipWidth); } else { e.Graphics.DrawImage(shipImagesCoast[p.GetID() % 8], -(shipWidth / 2), -(shipWidth / 2), shipWidth, shipWidth); } }