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(); }
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(); }