예제 #1
0
        private void OK_Click(object sender, EventArgs e)
        {
            accept = true;
            if (EASY.Checked == true)
            {
                kindgame = 1;
            }
            else if (MEDIUM.Checked == true)
            {
                kindgame = 2;
            }
            else
            {
                kindgame = 3;
            }
            //Information.PokemonNumber = 16 + (optionplay.kindgame - 1) * 6;
            Information.CurrentKindGame = Information.defaultPokemonNumber + (kindgame - 1) * 6;
            form.KindGame       = kindgame;
            form.Score          = 0;
            form.Level          = 1;
            form.argument.Level = 1;
            form.timeplay.Reset();
            form.lifetime.Life = 10 + (form.KindGame - 1) * 5;
            form.NewGame();
            Config config = OptionPlay.ReadConfig();
            int    tmp    = config.MaxLevel;

            config = new Config(form.effect, form.wayeffect.BackColor, form.English, form.KindGame, tmp);
            OptionPlay.WriteConfig(config);
            this.Close();
        }
예제 #2
0
        public LevelCharacter(Form1 form)
        {
            InitializeComponent();
            this.form  = form;
            p          = new PictureBox();
            p.Location = new Point(0, 0);
            p.Size     = new Size(7500, 520);
            this.Controls.Add(p);
            if (form.full == true)
            {
                this.Location = new Point(this.Location.X, this.Location.Y - 20);
            }
            Config config = OptionPlay.ReadConfig();

            for (int i = 0; i < 15; i++)
            {
                character[i]          = new PictureBox();
                character[i].Location = new Point(i * 500, 20);
                character[i].Size     = new Size(500, 500);
                character[i].SizeMode = PictureBoxSizeMode.Zoom;
                p.Controls.Add(character [i]);
                character[i].BackColor = Color.Transparent;
                character[i].Paint    += new PaintEventHandler(Character_Paint);
                character[i].Name      = Information.StringLevel + " " + (i + 1).ToString();
            }
            for (int i = 1; i <= config.MaxLevel; i++)
            {
                String Filename = Information.directories + "\\Collection\\";
                Filename += "Level" + (i).ToString() + ".UIT";
                if (File.Exists(Filename))
                {
                    try
                    {
                        ImageFile imagefile = ReadfileImage.ReadFile(Filename);
                        if (imagefile.ImageLevel != null && imagefile.level == i)
                        {
                            character[i - 1].Image = imagefile.ImageLevel;
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
            }
            p.BackColor   = Color.Transparent;
            time.Interval = 30;
            time.Tick    += new EventHandler(time_Tick);
            this.TopMost  = true;
            tmp           = 0;
            button1.Text  = Information.StringButtonCancel;
            label1.Text   = Information.StringCollectionPikemon;
        }
예제 #3
0
        private void NextLevel_Click(Object obj, EventArgs e)
        {
            if (Information.LockNextButton == true)
            {
                return;
            }

            NextClickCount++;
            if (NextClickCount == 1)
            {
                nextLevelEffect.Clickmore();
            }
            else if (NextClickCount == 2)
            {
                nextLevelEffect.Hide();
                NextLevel.Hide();

                lifetime.UpdateLife(true);
                Level++;
                Config config     = OptionPlay.ReadConfig();
                int    tmp_config = config.MaxLevel;
                if (Level - 1 > tmp_config)
                {
                    config = new Config(effect, wayeffect.BackColor, English, KindGame, Level - 1);
                    OptionPlay.WriteConfig(config);
                }
                if (Level < 16)
                {
                    NewGame();
                    LockGame = false;
                }
                else
                {
                    time.Stop();
                    gameLocking();
                    gameover = true;
                    PScreen.ShowScreenFinish();
                }
            }
        }
예제 #4
0
        private void OK_Click(object sender, EventArgs e)
        {
            if (checkBox1.Checked == true)
            {
                form.LockSound = false;
            }
            else
            {
                form.LockSound = true;
            }
            if (checkBox2.Checked == true)
            {
                form.effect = true;
            }
            else
            {
                form.effect = false;
            }
            if (language == 0)
            {
                form.English = true;
            }
            else
            {
                form.English = false;
            }
            if (checkBox3.Checked == true)
            {
                form.full = false;
            }
            else
            {
                form.full = true;
            }
            form.TurnOnScreen();
            if (color == 0)
            {
                form.wayeffect.BackColor = Color.DarkGreen;
            }
            else if (color == 1)
            {
                form.wayeffect.BackColor = Color.Blue;
            }
            else if (color == 2)
            {
                form.wayeffect.BackColor = Color.Red;
            }
            else if (color == 3)
            {
                form.wayeffect.BackColor = Color.Orange;
            }
            else if (color == 4)
            {
                form.wayeffect.BackColor = Color.Yellow;
            }

            /*else if (color == 5)
             *  form.wayeffect.BackColor = Color.Blue;*/
            if (language == 0)
            {
                Information.English();
                form.English = true;
            }
            else
            {
                Information.Vietnamese();
                form.English = false;
            }
            form.ChoosingLanguage();
            this.Close();
            Config config = OptionPlay.ReadConfig();
            int    tmp    = config.MaxLevel;

            config = new Config(form.effect, form.wayeffect.BackColor, form.English, form.KindGame, tmp);
            OptionPlay.WriteConfig(config);
        }
예제 #5
0
        public void SetRecord()
        {
            int tmp = 0;

            if (KindGame == 1)
            {
                UIT_PokemonHighScore.List_highscore high_score = UIT_PokemonHighScore.HighScoreGame.ReadHighScore();

                if (Score > high_score.player_easy.GetMinScore())
                {
                    if (Score > high_score.player_easy.GetMaxScore())
                    {
                        tmp = 1;
                    }
                    InputName IN = new InputName(this, tmp);
                    IN.ShowDialog();
                    IN.Dispose();
                }
            }
            else if (KindGame == 2)
            {
                UIT_PokemonHighScore.List_highscore high_score = UIT_PokemonHighScore.HighScoreGame.ReadHighScore();
                if (Score > high_score.player_mid.GetMinScore())
                {
                    if (Score > high_score.player_mid.GetMaxScore())
                    {
                        tmp = 1;
                    }
                    InputName IN = new InputName(this, tmp);
                    IN.ShowDialog();
                    IN.Dispose();
                }
            }
            else
            {
                UIT_PokemonHighScore.List_highscore high_score = UIT_PokemonHighScore.HighScoreGame.ReadHighScore();
                if (Score > high_score.player_hard.GetMinScore())
                {
                    if (Score > high_score.player_hard.GetMaxScore())
                    {
                        tmp = 1;
                    }
                    InputName IN = new InputName(this, tmp);
                    IN.ShowDialog();
                    IN.Dispose();
                }
            }
            Config config     = OptionPlay.ReadConfig();
            int    tmp_config = config.MaxLevel;

            if (Level - 1 > tmp_config)
            {
                config = new Config(effect, wayeffect.BackColor, English, KindGame, Level - 1);
                OptionPlay.WriteConfig(config);
            }
            PScreen.HideScreen();
            HighScore high = new HighScore(KindGame - 1);

            high.ShowDialog();
            high.Dispose();
        }
예제 #6
0
        private void InitializePokemon()
        {
            this.SuspendLayout();
            PScreen = new PauseScreen(this);
            this.Controls.Add(PScreen);
            templateScreen          = new PictureBox();
            templateScreen.Size     = new Size(1100, 800);
            templateScreen.Location = new Point(100, 100);
            this.Controls.Add(templateScreen);
            RandomPokemon          = new RibbonButton(" Random");
            RandomPokemon.Location = new Point(400, 15);
            RandomPokemon.Image    = global::UIT_Pokemon.Properties.Resources.changebutton;
            RandomPokemon.Click   += new EventHandler(RandomPokemon_Click);
            this.Controls.Add(RandomPokemon);
            HelpPokemon          = new RibbonButton("   Help");
            HelpPokemon.Location = new Point(580, 15);
            HelpPokemon.Image    = global::UIT_Pokemon.Properties.Resources.findbutton;
            HelpPokemon.Click   += new EventHandler(HelpPokemon_Click);
            this.Controls.Add(HelpPokemon);
            FullScreen          = new RibbonButton("  Full Screen");
            FullScreen.Location = new Point(760, 15);
            FullScreen.Image    = global::UIT_Pokemon.Properties.Resources.Full;
            FullScreen.Click   += new EventHandler(FullScreen_Click);
            this.Controls.Add(FullScreen);
            NextLevel          = new SpecilButton(0);
            NextLevel.Location = new Point(630, 620);
            NextLevel.Click   += new EventHandler(NextLevel_Click);
            NextLevel.Text     = "NEXT";
            this.Controls.Add(NextLevel);
            NextLevel.Hide();
            wayeffect = new WayEffect(this);
            this.Controls.Add(wayeffect);
            for (int y = 0; y < IDHeight; y++)
            {
                for (int x = IDWith - 1; x >= 0; x--)
                {
                    PokemonPiece[x, y] = new Piece(x, y);
                    this.Controls.Add(PokemonPiece[x, y]);
                    PokemonPiece[x, y].Click += new EventHandler(PokemonPiece_Click);
                }
            }
            try
            {
                GC.Collect();
            }
            catch { }
            utilitypanel = new UtilityPanel(this);
            this.Controls.Add(utilitypanel);
            optionpanel = new OptionPanel(this);
            this.Controls.Add(optionpanel);
            limittime = new Limittime(this);
            this.Controls.Add(limittime);
            PauseButton          = new SpecilButton(1);
            PauseButton.Location = new Point(6, 13);
            PauseButton.Click   += new EventHandler(PauseButton_Click);
            PauseButton.Text     = "PAUSE";
            this.Controls.Add(PauseButton);

            lifetime          = new LifeTime(this);
            lifetime.Location = new Point(this.Width - 205, -80);
            this.Controls.Add(lifetime);
            Config config = OptionPlay.ReadConfig();

            if (config.English == false)
            {
                this.English = false;
                Information.Vietnamese();
                ChoosingLanguage();
            }
            wayeffect.BackColor         = config.color;
            this.effect                 = config.effect;
            this.KindGame               = config.kindgame;
            lifetime.Life               = 10 + (KindGame - 1) * 5;
            Information.CurrentKindGame = Information.defaultPokemonNumber + (KindGame - 1) * 6;
            this.ResumeLayout();
        }