public void Reset() { //Resets everything label_Dead.Visible = false; int x = 0; foreach (PictureBox Bomb in Bombs) { if (Bomb != null) { //Removes all the bombs Bomb.Dispose(); Bombs[x] = null;; } x++; } int x2 = 0; foreach (PictureBox Boom in Explosives) { if (Boom != null) { //Removes all the bombs Boom.Dispose(); Bombs[x2] = null;; } x2++; } pb_Player.Visible = true; //Sets the player visible and moves him to start location pb_Player.Location = new System.Drawing.Point(167, WorldFrame.Size.Height - 10 - pb_Player.Height); pb_NPC1.Location = new System.Drawing.Point(1, WorldFrame.Size.Height - 1 - pb_NPC1.Height); pb_NPC2.Location = new System.Drawing.Point(WorldFrame.Width - 10, WorldFrame.Size.Height - 1 - pb_NPC2.Height); pb_Player.Image = Character.stand_r; Score = 0; BombSize = 16; GameOn = true; }
public void RemovePictureBoxAt(int x, int y) { foreach (PictureBox Boom in Explosives) { if (Boom != null) { if (Boom.Location.X == x && Boom.Location.Y == y) { Boom.Dispose(); } } } }
public void RemovePictureBoxAt(int x, int y) { foreach (PictureBox Boom in Explosives) { // Not sure why I added this here, remove if you want otherwise fuckit. if (Boom != null) { if (Boom.Location.X == x && Boom.Location.Y == y) { Boom.Dispose(); } } } }
private void timerBoomRemove_Tick(object sender, EventArgs e) { foreach (Control X in this.Controls) { if (X is PictureBox) { if (X.Name == "Boom") { X.Dispose(); } } } foreach (PictureBox Boom in Explosives) { if (Boom != null) { Boom.Dispose(); } } }