private void Boom(int ww, int hh, int w, int h, Point[] points) { Pen pen = new Pen(Color.Red); Graphics g = GameBox.CreateGraphics(); Image image; SoundPlayer player; player = new SoundPlayer(string.Format("Sound/exp{0}.wav", Ran.Next(1, 3))); player.Play(); for (int i = 1; i <= 6; ++i) { image = (Bitmap)rm.GetObject("B" + i); if (i <= 3) { g.DrawLines(pen, points); } g.DrawImage(image, Block.BlockWidth * ww, Block.BlockHeight * hh, Block.BlockWidth, Block.BlockHeight); g.DrawImage(image, Block.BlockWidth * w, Block.BlockHeight * h, Block.BlockWidth, Block.BlockHeight); Thread.Sleep(100); } GameBox.Invalidate(); }
private void Start_Click(object sender, EventArgs e) { GameBox.Visible = true; map = new BlockMap(); GameBox.Size = map.GetMapSize(); Graphics g = GameBox.CreateGraphics(); PaintMap(g); Start.Enabled = false; Tip.Enabled = true; MessUp.Enabled = true; gameStatus = GameStatus.Playing; preHit = DateTime.Now.Ticks; combo = 0; score = 0; maxCombo = 0; messUpTime = 1; tipTime = 3; MessUp.Text = string.Format("打乱({0})", messUpTime); Tip.Text = string.Format("提示({0})", tipTime); timeLeft = 60; CountDown.Visible = true; timer = new System.Threading.Timer(update, null, 0, 500); }