Exemplo n.º 1
0
 private void btnReturnToMenu_Click(object sender, EventArgs e)
 {
     MenuForm frmMenu = new MenuForm();
     //show the menu window
     frmMenu.Show();
     //and hide the game window
     this.Hide();
 }
Exemplo n.º 2
0
 //Returns user to main user menu
 private void btnReturn_Click_1(object sender, EventArgs e)
 {
     //creates a new menu form
     MenuForm frmMenu = new MenuForm();
     //show the menu window
     frmMenu.Show();
     //hides current level editor window
     this.Hide();
     //hide the menu form
 }
Exemplo n.º 3
0
 //Creates a new Game Form
 public GameForm(MenuForm menu, string levelToLoad)
 {
     InitializeComponent();
     //set the menu passed in as the menu form
     frmMenu = menu;
     //stores the name of the level that will be played
     levelToPlay = levelToLoad;
     this.DoubleBuffered = true;//This sets the form so it won't flicker when animating a lot of objects quickly
     //sets up necessary options for the form
     this.SetStyle(ControlStyles.UserPaint |
                   ControlStyles.AllPaintingInWmPaint |
                   ControlStyles.ResizeRedraw |
                   ControlStyles.ContainerControl |
                   ControlStyles.OptimizedDoubleBuffer |
                   ControlStyles.SupportsTransparentBackColor
                   , true);
     UpdateStyles();
 }