示例#1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            this.SetStyle(ControlStyles.AllPaintingInWmPaint |
                          ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer, true);


            ////pipe
            pipe.PipeInGame(this, pipe, bird);

            ////// coins
            coins.GetCoins(this, bird, pipe);
            coins.CoinsInGame(bird);
            coins.Impact_Coins_Bird(bird);


            ////// hearts
            heart.GetHearts(this, bird, pipe);
            heart.HeartsInGame(bird);
            heart.Impact_Hearts_Bird(bird);


            /// lifespan
            lifeSpan.DrawLifeSpan();

            if (heart.sign_getHearts)
            {
                lifeSpan.Increase(heart);
            }


            // shield character
            if (lifeSpan.GetCount() == 1)
            {
                lifeSpan.shield_Apearance = false;
            }

            if (lifeSpan.GetCount() > 1)
            {
                lifeSpan.SetVisibleOn(bird);
            }

            lifeSpan.Impact_Shield_Pipes(pipe, bird, heart);
            lifeSpan.Impact_Shield_Rocket(rocket, bird);
            if (heart.sign_decreaseHearts)
            {
                lifeSpan.Decrease(heart);
            }

            ////// rocket
            rocket.GetRocket(this, bird, pipe);
            rocket.RocketInGame(bird);
            rocket.Impact_Rocket_Bird(bird, gift, lifeSpan, timer_Bird, timer1);
            rocket.InvisibleEmergency(this);

            ////// Gift
            gift.GetGift(this, pipe);
            gift.GiftInGame();
            gift.Impact_Gift_Bird(bird, timer1, timer_Bird, timer2);

            //
            Invalidate();

            //// bird
            bird.GetScore(pipe, label1);


            label1.Text = bird.scoreOfGame.ToString();
        }
示例#2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            this.SetStyle(ControlStyles.AllPaintingInWmPaint |
                          ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer, true);

            //pipe
            pipe.PipeInGame(this, pipe, bird);

            //// coins
            coins.GetCoins(this, bird, pipe);
            coins.CoinsInGame();
            coins.Impact_Coins_Bird(bird);

            //// hearts
            heart.GetHearts(this, bird, pipe);
            heart.HeartsInGame();
            heart.Impact_Hearts_Bird(bird);


            /// lifespan
            lifeSpan.DrawLifeSpan();

            if (heart.sign_getHearts)
            {
                lifeSpan.Increase(heart);
                //heart.sign_getHearts = false;
            }


            // shield character
            if (lifeSpan.GetCount() == 1)
            {
                lifeSpan.picBoxShieldCharacter.Visible = false;
            }

            if (lifeSpan.GetCount() > 1)
            {
                lifeSpan.SetVisibleOn(bird.X_Bird + 37, bird.Y_Bird - 30);
            }

            //lifeSpan.Impact_Shield_Rocket(rocket, bird);
            lifeSpan.Impact_Shield_Pipes(pipe, bird, heart);
            if (heart.sign_decreaseHearts)
            {
                lifeSpan.Decrease(heart);
                MessageBox.Show(lifeSpan.GetCount().ToString());
            }
            //// rocket

            /*rocket.GetRocket(this, bird, pipe);
             * rocket.RocketInGame();
             * rocket.Impact_Rocket_Bird(bird, gift, lifeSpan, timer_Bird, timer1);
             * rocket.InvisibleEmergency(this);
             *
             * //// Gift
             * gift.GetGift(this, pipe);
             * gift.GiftInGame();
             * gift.Impact_Gift_Bird(bird, timer1, timer_Bird, timer2);*/
            // bird
            bird.GetScore(pipe, label1);
            //MessageBox.Show(bird.GetScore(pipe, label1));
            highScore.HighScore();



            //HighScoreInf
            //label1.Text = bird.scoreOfGame.ToString();
        }