Пример #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (level1.powerups == 3)
     {
         if (level10_11map.level == 11)
         {
             this.Hide();
             level11_12map mbpu = new level11_12map();
             mbpu.ShowDialog();
             this.Close();
         }
         else
         {
             if (level9_10map.level == 10)
             {
                 if (level10_11map.level == 11)
                 {
                     this.Hide();
                     level11_12map mbpu = new level11_12map();
                     mbpu.ShowDialog();
                     this.Close();
                 }
                 else
                 {
                     if (level8_9mapcs.level == 9)
                     {
                         if (level10_11map.level == 11)
                         {
                             this.Hide();
                             level11_12map mbpu = new level11_12map();
                             mbpu.ShowDialog();
                             this.Close();
                         }
                         else
                         {
                             if (level7_8map.level == 8)
                             {
                                 if (level10_11map.level == 11)
                                 {
                                     this.Hide();
                                     level10_11map mbpu = new level10_11map();
                                     mbpu.ShowDialog();
                                     this.Close();
                                 }
                                 else
                                 {
                                     if (level6_7map.level == 7)
                                     {
                                         if (level10_11map.level == 11)
                                         {
                                             this.Hide();
                                             level9_10map mbpu = new level9_10map();
                                             mbpu.ShowDialog();
                                             this.Close();
                                         }
                                         else
                                         {
                                             if (level5_6map.level == 6)
                                             {
                                                 this.Hide();
                                                 level9_10map mbpu = new level9_10map();
                                                 mbpu.ShowDialog();
                                                 this.Close();
                                             }
                                             else
                                             {
                                                 if (level4_5map.level == 5)
                                                 {
                                                     this.Hide();
                                                     level5_6map mbpu = new level5_6map();
                                                     mbpu.ShowDialog();
                                                     this.Close();
                                                 }
                                                 else
                                                 {
                                                     if (level3_4.level == 4)
                                                     {
                                                         this.Hide();
                                                         level5_6map mbpu = new level5_6map();
                                                         mbpu.ShowDialog();
                                                         this.Close();
                                                     }
                                                     else
                                                     {
                                                         if (level2_3map.level == 3)
                                                         {
                                                             this.Hide();
                                                             level5_6map mbpu = new level5_6map();
                                                             mbpu.ShowDialog();
                                                             this.Close();
                                                         }
                                                         else
                                                         {
                                                             if (level1_2map.level == 2)
                                                             {
                                                                 this.Hide();
                                                                 level5_6map mbpu = new level5_6map();
                                                                 mbpu.ShowDialog();
                                                                 this.Close();
                                                             }
                                                             else
                                                             {
                                                                 this.Hide();
                                                                 level5_6map mbpu = new level5_6map();
                                                                 mbpu.ShowDialog();
                                                                 this.Close();
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     else if (level1.powerups == 6)
     {
         if (level10_11map.level == 11)
         {
             this.Hide();
             level11_12map mbpu = new level11_12map();
             mbpu.ShowDialog();
             this.Close();
         }
         else
         {
             if (level9_10map.level == 10)
             {
                 if (level10_11map.level == 11)
                 {
                     this.Hide();
                     level11_12map mbpu = new level11_12map();
                     mbpu.ShowDialog();
                     this.Close();
                 }
                 else
                 {
                     if (level8_9mapcs.level == 9)
                     {
                         if (level10_11map.level == 11)
                         {
                             this.Hide();
                             level11_12map mbpu = new level11_12map();
                             mbpu.ShowDialog();
                             this.Close();
                         }
                         else
                         {
                             if (level7_8map.level == 8)
                             {
                                 if (level10_11map.level == 11)
                                 {
                                     this.Hide();
                                     level11_12map mbpu = new level11_12map();
                                     mbpu.ShowDialog();
                                     this.Close();
                                 }
                                 else
                                 {
                                     if (level6_7map.level == 7)
                                     {
                                         if (level10_11map.level == 11)
                                         {
                                             this.Hide();
                                             level9_10map mbpu = new level9_10map();
                                             mbpu.ShowDialog();
                                             this.Close();
                                         }
                                         else
                                         {
                                             if (level5_6map.level == 6)
                                             {
                                                 this.Hide();
                                                 level9_10map mbpu = new level9_10map();
                                                 mbpu.ShowDialog();
                                                 this.Close();
                                             }
                                             else
                                             {
                                                 if (level4_5map.level == 5)
                                                 {
                                                     this.Hide();
                                                     level8_9mapcs mbpu = new level8_9mapcs();
                                                     mbpu.ShowDialog();
                                                     this.Close();
                                                 }
                                                 else
                                                 {
                                                     if (level3_4.level == 4)
                                                     {
                                                         this.Hide();
                                                         level8_9mapcs mbpu = new level8_9mapcs();
                                                         mbpu.ShowDialog();
                                                         this.Close();
                                                     }
                                                     else
                                                     {
                                                         if (level2_3map.level == 3)
                                                         {
                                                             this.Hide();
                                                             level8_9mapcs mbpu = new level8_9mapcs();
                                                             mbpu.ShowDialog();
                                                             this.Close();
                                                         }
                                                         else
                                                         {
                                                             if (level1_2map.level == 2)
                                                             {
                                                                 this.Hide();
                                                                 level5_6map mbpu = new level5_6map();
                                                                 mbpu.ShowDialog();
                                                                 this.Close();
                                                             }
                                                             else
                                                             {
                                                                 this.Hide();
                                                                 level5_6map mbpu = new level5_6map();
                                                                 mbpu.ShowDialog();
                                                                 this.Close();
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Пример #2
0
        private void tmrVillan_Tick(object sender, EventArgs e)
        {
            for (int i = 0; i < 7; i++)
            {
                score        += villan[i].score;  // get score from Planet class (in movePlanet method)
                txtscore.Text = score.ToString(); // display score
                villan[i].moveVillan();
                if (character.characterRec.IntersectsWith(villan[i].villanRec))
                {
                    //reset planet[i] back to top of panel
                    villan[i].x   = 10;               // set  y value of planetRec
                    lives        -= 1;                // lose a life
                    txtLives.Text = lives.ToString(); // display number of lives
                    checkLives();
                }

                if (level11_12map.level == 12)
                {
                    if (score >= 500)
                    {
                        tmrVillan.Enabled = false;
                        tmrHero.Enabled   = false;
                    }
                }

                else
                {
                    if (level10_11map.level == 11)
                    {
                        if (score >= 500)
                        {
                            this.Hide();
                            tmrVillan.Enabled = false;
                            tmrHero.Enabled   = false;
                            level10_11map l10to11m = new level10_11map();
                            l10to11m.ShowDialog();
                            this.Close();
                        }
                    }
                    else
                    {
                        if (level9_10map.level == 10)
                        {
                            if (score >= 500)
                            {
                                this.Hide();
                                tmrVillan.Enabled = false;
                                tmrHero.Enabled   = false;
                                level9_10map l9to10m = new level9_10map();
                                l9to10m.ShowDialog();
                                this.Close();
                            }
                        }

                        else
                        {
                            if (level8_9mapcs.level == 9)
                            {
                                if (score >= 500)
                                {
                                    this.Hide();
                                    tmrVillan.Enabled = false;
                                    tmrHero.Enabled   = false;
                                    level8_9mapcs l8to9m = new level8_9mapcs();
                                    l8to9m.ShowDialog();
                                    this.Close();
                                }
                            }

                            else
                            {
                                if (level7_8map.level == 8)
                                {
                                    if (score >= 500)
                                    {
                                        this.Hide();
                                        tmrVillan.Enabled = false;
                                        tmrHero.Enabled   = false;
                                        level7_8map l7to8m = new level7_8map();
                                        l7to8m.ShowDialog();
                                        this.Close();
                                    }
                                }
                                else
                                {
                                    if (level6_7map.level == 7)
                                    {
                                        if (score >= 500)
                                        {
                                            this.Hide();
                                            tmrVillan.Enabled = false;
                                            tmrHero.Enabled   = false;
                                            level6_7map l6to7m = new level6_7map();
                                            l6to7m.ShowDialog();
                                            this.Close();
                                        }
                                    }

                                    else
                                    {
                                        if (level5_6map.level == 6)
                                        {
                                            if (score >= 500)
                                            {
                                                this.Hide();
                                                tmrVillan.Enabled = false;
                                                tmrHero.Enabled   = false;
                                                level6_7map l6to7m = new level6_7map();
                                                l6to7m.ShowDialog();
                                                this.Close();
                                            }
                                        }

                                        else
                                        {
                                            if (level4_5map.level == 5)
                                            {
                                                if (score >= 500)
                                                {
                                                    this.Hide();
                                                    tmrVillan.Enabled = false;
                                                    tmrHero.Enabled   = false;
                                                    level5_6map l5to6m = new level5_6map();
                                                    l5to6m.ShowDialog();
                                                    this.Close();
                                                }
                                            }

                                            else
                                            {
                                                if (level3_4.level == 4)
                                                {
                                                    if (score >= 500)
                                                    {
                                                        this.Hide();
                                                        tmrVillan.Enabled = false;
                                                        tmrHero.Enabled   = false;
                                                        level4_5map l4to5m = new level4_5map();
                                                        l4to5m.ShowDialog();
                                                        this.Close();
                                                    }
                                                }
                                                else
                                                {
                                                    if (level2_3map.level == 3)
                                                    {
                                                        if (score >= 500)
                                                        {
                                                            this.Hide();
                                                            tmrVillan.Enabled = false;
                                                            tmrHero.Enabled   = false;
                                                            level3_4 l3to4m = new level3_4();
                                                            l3to4m.ShowDialog();
                                                            this.Close();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if (level1_2map.level == 2)
                                                        {
                                                            if (score >= 500)
                                                            {
                                                                this.Hide();
                                                                tmrVillan.Enabled = false;
                                                                tmrHero.Enabled   = false;
                                                                level2_3map l1to2m = new level2_3map();
                                                                l1to2m.ShowDialog();
                                                                this.Close();
                                                            }
                                                        }

                                                        else
                                                        {
                                                            if (score >= 200)
                                                            {
                                                                this.Hide();
                                                                tmrVillan.Enabled = false;
                                                                tmrHero.Enabled   = false;
                                                                level1_2map l1to2m = new level1_2map();
                                                                l1to2m.ShowDialog();
                                                                this.Close();
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }


                pnlGame.Invalidate();
                //makes the paint event fire to redraw the panel
            }
        }