예제 #1
0
        private void StartGameBtn_Click(object sender, RoutedEventArgs e)
        {
            RocketShop.Visibility       = Visibility.Hidden;
            FirstPanzerInfo.Visibility  = Visibility.Visible;
            SecondPanzerInfo.Visibility = Visibility.Visible;

            scene.Dispose();

            settings = new BattleSceneSettings();
            int firstPanzerPowerfulRockets  = int.Parse(FirstPanzerPowerfulRockets.Content.ToString());
            int firstPanzerFastRockets      = int.Parse(FirstPanzerFastRockets.Content.ToString());
            int firstPanzerRockets          = int.Parse(FirstPanzerRockets.Content.ToString());
            int secondPanzerPowerfulRockets = int.Parse(SecondPanzerPowerfulRockets.Content.ToString());
            int secondPanzerFastRockets     = int.Parse(SecondPanzerFastRockets.Content.ToString());
            int secondPanzerRockets         = int.Parse(SecondPanzerRockets.Content.ToString());

            settings.SetFirstPanzerAmounts(firstPanzerPowerfulRockets, firstPanzerFastRockets, firstPanzerRockets);
            settings.SetSecondPanzerAmounts(secondPanzerPowerfulRockets, secondPanzerFastRockets, secondPanzerRockets);
            settings.FirstPanzerHealth      = 100;
            settings.SecondPanzerHealth     = 100;
            settings.FirstPanzerControlType = (bool)IsFirstAI.IsChecked ?
                                              BattleSceneSettings.PanzerControlType.AI :
                                              BattleSceneSettings.PanzerControlType.Keyboard;
            settings.SecondPanzerControlType = (bool)IsSecondAI.IsChecked ?
                                               BattleSceneSettings.PanzerControlType.AI :
                                               BattleSceneSettings.PanzerControlType.Keyboard;
            scene = new BattleScene(this, settings);
            scene.Init();
            renderer = new Renderer(scene);
        }
예제 #2
0
 private void InitStartScreen()
 {
     settings = new BattleSceneSettings();
     settings.SetFirstPanzerAmounts(int.MaxValue, int.MaxValue, int.MaxValue);
     settings.SetSecondPanzerAmounts(int.MaxValue, int.MaxValue, int.MaxValue);
     settings.FirstPanzerHealth       = int.MaxValue;
     settings.SecondPanzerHealth      = int.MaxValue;
     settings.FirstPanzerControlType  = BattleSceneSettings.PanzerControlType.AI;
     settings.SecondPanzerControlType = BattleSceneSettings.PanzerControlType.AI;
 }