public partial class RenderWindow : Form { public void showMenu() { Image Out = Image.FromFile(dataPath + "Graphics/GUI/box.png"); Image Over = Image.FromFile(dataPath + "Graphics/GUI/boxOver.png"); GUI[0] = new GUIBox(Out, new Point((bounds.Width / 2) - (Out.Width / 2), 100)); GUI[0].SetMouseOut(Out); GUI[0].SetMouseOver(Over); GUI[0].UpdateBounds(); GUI[1] = new GUIBoxCustomMap(Out, new Point((bounds.Width / 2) - (Over.Width / 2), 200)); GUI[1].SetMouseOut(Out); GUI[1].SetMouseOver(Over); GUI[1].UpdateBounds(); } public static void startGame(int Level) { RenderWindow gah = new RenderWindow(); gah.Score = 0; gah.IsInGame = true; gah.Paused = false; Point MouseLocation = gah.MouseLocation; for (int i = 0; i < gah.Balls.Length; i++) { gah.Balls[i].IsActive = false; } gah.Balls[0] = new BallSprite(dataPath + "Graphics/ball.png", new Point(MouseLocation.X, bounds.Bottom - 50), 3, 5); gah.Balls[0].IsActive = true; gah.LoadLevel(Level); } } class GUIBox : GUI { public GUIBox(Image InitialImage, Point Pos) : base(InitialImage, Pos) { } public override void HandleClick() { RenderForm.RenderWindow.startGame(1); } }