private void Form1_Load(object sender, EventArgs e) { //this.WindowState = FormWindowState.Maximized; this.Size = new Size(1500, 800); // Ресуем финиш finish = new Finish(this); // Рисуем игрока Player = new Model1(); // Отображаем все label1.Text = Convert.ToString(Player.life); // Отображаем жизни pictureBoxMain.Controls.Add(Player.Player); pictureBoxMain.Controls.Add(finish.finish); // Окружение min = new Mines(); tree = new Trees(); rocks = new Rock(); // Минируем поле min.Mining(this, pictureBoxMain, Envi); // Размещаем деревья tree.Landing(this, pictureBoxMain, Envi); // Камни rocks.Resp(this, pictureBoxMain, Envi); Game_time.Start(); Bombs.Start(); Respawn_enemies.Start(); }
public void Let(Model1 Player, Trees tree, Rock rock, Enemies enemies) // Препятствие { if (Player.Rideability == true) { for (int i = 0; i < tree.Trees_mass.Length; i++) { if (Crossing(Player.Player, tree.Trees_mass[i]) && tree.Let[i] != true) { Bias(Player); Player.Rideability = false; } else { Player.Rideability = true; } for (int j = 0; j < enemies.Enemies_mass.LongCount(); j++) { if (Crossing(enemies.Enemies_mass[j], tree.Trees_mass[i]) && tree.Let[i] != true) { enemies.Bias(enemies, j); } else { enemies.Rideability = true; } } } for (int i = 0; i < rock.Rock_mass.Length; i++) { if (Crossing(Player.Player, rock.Rock_mass[i])) { Bias(Player); } else { Player.Rideability = true; } for (int j = 0; j < enemies.Enemies_mass.LongCount(); j++) { if (Crossing(enemies.Enemies_mass[j], rock.Rock_mass[i])) { enemies.Bias(enemies, j); } else { enemies.Rideability = true; } } } } }
public void Destruction_tree(Trees Mass_tree) { for (int i = 0; i < BulletCount; i++) { for (int j = 0; j < Mass_tree.Trees_mass.LongLength; j++) { if (Crossing(Bullets[i], Mass_tree.Trees_mass[j])) { Mass_tree.Trees_mass[j].Image = Image.FromFile(@"tree/tree_false.png"); Mass_tree.Trees_mass[j].Size = new Size(Mass_tree.Trees_mass[j].Image.Width, Mass_tree.Trees_mass[j].Image.Height); Mass_tree.Trees_mass[j].Location = new Point(Mass_tree.Trees_mass[j].Location.X + 50, Mass_tree.Trees_mass[j].Location.Y + 100); Mass_tree.Let[j] = true; } } } }