コード例 #1
0
ファイル: DLG_Main.cs プロジェクト: JKrueckl/AsteroidsRemixed
        private void UI_B_Start_Click(object sender, EventArgs e)
        {
            UI_Menu_Panel.Hide();
            UI_GameOver_Panel.Hide();
            Focus();

            if (_playerLives == 0)
            {
                _waveNumber  = 1;
                _playerScore = 0;
                _playerLives = 3;
                _player      = new PlayerInfo();
                _rockContainer.Clear();

                // Init wave calc
                _wc = new WaveCalculator(_waveNumber);

                // Spawn the first wave
                for (int i = 0; i < _wc.Rocks; i++)
                {
                    _rockContainer.Add(new Rock(new PointF(_rnd.Next(0, ClientRectangle.Width), _rnd.Next(0, ClientRectangle.Height)), Rock.State.large));
                }

                _generatedBG = new BackgroundImg(ClientRectangle);
            }

            _starting = false;
        }
コード例 #2
0
ファイル: DLG_Main.cs プロジェクト: JKrueckl/AsteroidsRemixed
        private void DLG_Main_Load(object sender, EventArgs e)
        {
            UI_Menu_Panel.Location     = new Point((ClientSize.Width / 2) - (UI_Menu_Panel.Width / 2), 10);
            UI_Pause_Panel.Location    = new Point((ClientSize.Width / 2) - (UI_Menu_Panel.Width / 2), 10);
            UI_GameOver_Panel.Location = new Point((ClientSize.Width / 2) - (UI_Menu_Panel.Width / 2), 400);
            UI_Pause_Panel.Hide();
            UI_GameOver_Panel.Hide();

            #region Debug Mode
            if (DEBUG_MODE)
            {
                DebugWindow = new DLG_Debug();
                DebugWindow.Show();

                setValCallback += new SetValDel(DebugWindow.TranslateInformation);
            }
            #endregion

            // Create NEW RANDOM BACKGROUND
            _generatedBG = new BackgroundImg(ClientRectangle);

            // Enemy Two test
            //_enemyTwo = new EnemyTwo(ClientRectangle);

            // Sound testing fun!
            //SoundPlayer lazer = new SoundPlayer();
            //lazer.SoundLocation = "Lazer.wav";

            //_sounds.Add("Lazer", lazer);

            // Boss rock test
            //_testRock = new RockBoss(new PointF(300, 300), Rock.State.boss);

            // Init wave calc
            _wc = new WaveCalculator(_waveNumber);

            // Spawn the first wave
            for (int i = 0; i < _wc.Rocks; i++)
            {
                _rockContainer.Add(new Rock(new PointF(_rnd.Next(0, ClientRectangle.Width), _rnd.Next(0, ClientRectangle.Height)), Rock.State.large));
            }
        }
コード例 #3
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            BackgroundImg.Blur(value: 15, duration: 0).Start();
        }