private void btnStart_Click(object sender, EventArgs e) { Form lvlSelecet = new LevelSelectScreen(this, startupConfig); lvlSelecet.FormClosing += delegate { this.Close(); }; hideForm(); lvlSelecet.Show(); }
void timer_Tick(object sender, EventArgs e) { if (!lvl.ball.isDead) { if (firstStartForBall == false) { if (lvl.bricks.Count == 0) { timer.Stop(); if (MessageBox.Show("Честито, успешно го завршивте нивото бр." + lvl.id + " !", "Играта заврши", MessageBoxButtons.OK) == System.Windows.Forms.DialogResult.OK) { lss.Show(); this.Hide(); } } lvl.ball.Move(leftX, topY, width, height); lvl.ball.IsColiding(lvl.slider); lvl.BallColidingWithBrick(); } } else { timer.Stop(); if (!lvl.resetComponents(startupConfig)) { Invalidate(true); if (MessageBox.Show("Вие изгубивте!", "Играта заврши", MessageBoxButtons.OK) == System.Windows.Forms.DialogResult.OK) { lss.Show(); this.Hide(); } } firstStartForBall = true; } Invalidate(true); }