private void Play_Click2(object sender, RoutedEventArgs e) {//--több játékos-- a players be rakja a létrehozott játékosokat players.AddRange(mpvm.players); switch (mmvm.SelectedGamemode) {//kiválasztja a játékmódot case gamemode_type.Normál: gm = new DefaultGameMode(players); break; case gamemode_type.Extrém: gm = new ExtremeGameMode(players); break; case gamemode_type.Időkorlát: gm = new TimerGameMode(players); break; case gamemode_type.Gyakorlás: gm = new PracticeGameMode(players); break; } mmvm = null;//ez nem tudom minek... GameStart(); }
private void Play_Click1(object sender, RoutedEventArgs e) { //--egy játékos-- players.Add(new Gamer(spvm.Name, spvm.Selected, Key.Up, Key.Left, Key.Right, Key.Space, 1)); //fix gombokkal :( switch (mmvm.SelectedGamemode) { //játékmód kiválasztása case gamemode_type.Normál: gm = new DefaultGameMode(players); break; case gamemode_type.Extrém: gm = new ExtremeGameMode(players); break; case gamemode_type.Időkorlát: gm = new TimerGameMode(players); break; case gamemode_type.Gyakorlás: gm = new PracticeGameMode(players); break; } mmvm = null; GameStart(); }
/*private void Timer_Tick(object sender, EventArgs e) * { * bool called = false; * if (DateTime.Now.Second==0 && !called) * { * CallSecondTick(DateTime.Now.Minute); * called = true; * }//ha gyorsabb a tick mint 1 mp akkor többször is meg hívódna mint kell * if (called && DateTime.Now.Second == 10) * { * called = false; * } * }*/ private void CreateMainMenu() { Log.Message("Menü létrehozva."); gm = null; ovm = null; gevm = null; spvm = null; mpvm = null; mmvm = null; players = null; players = new List <Gamer>(); mmvm = new MainMenuViewModel(); g.Children.Clear(); //play gomb Button play = new Button(); play.Margin = new Thickness(0, -250, 0, 0); play.Height = 50; play.Width = 200; play.FontSize = 20; play.Content = "Játék"; play.Click += Play_Click; //exit gomb Button exit = new Button(); exit.Height = 50; exit.Margin = new Thickness(0, 100, 0, 0); exit.Width = 200; exit.FontSize = 20; exit.Content = "Kilépés"; exit.Click += Exit_Click; //options Button options = new Button(); options.Height = 50; options.Margin = new Thickness(0, -10, 0, 0); options.Width = 200; options.FontSize = 20; options.Content = "Beállítások"; options.Click += Options_Click; //gamemode Label gml = new Label(); gml.Height = 30; gml.Width = 100; gml.Content = "Játékmód"; gml.Margin = new Thickness(0, -160, 0, 0); gml.FontSize = 15; //játékmód ComboBox cb = new ComboBox(); cb.Height = 30; cb.Width = 200; cb.Margin = new Thickness(0, -100, 0, 0); cb.BorderBrush = Brushes.Black; cb.FontSize = 15; cb.SetBinding(ComboBox.SelectedItemProperty, new Binding("SelectedGamemode")); cb.SetBinding(ComboBox.ItemsSourceProperty, new Binding("GameModeList")); g.Children.Add(cb); g.Children.Add(gml); g.Children.Add(options); g.Children.Add(play); g.Children.Add(exit); DataContext = mmvm; }