private void Application_WindowResize(Workbook Wb, Window Wn) { if (GameTimer.Enabled) { GameTimer.Enabled = false; } Wplane.Show(CurrentBlock.BlockWidth); CurrentBlock.SetNewCoordination((CurrentBlock.X / CurrentBlock.BlockWidth) * Gwidth, (CurrentBlock.Y / CurrentBlock.BlockWidth) * Gwidth); CurrentBlock.Blockwidth = Gwidth; CurrentBlock.Show(); }
private int Wplane_GameFailed(int Args) { MessageBox.Show("You lost and the score is " + Score.ToString()); foreach (Shape s in this.GameSheet.Shapes) { s.Delete(); } Wplane = new GamePlane(GameSheet, RowNum, ColNum); this.CurrentBlock = new Gameblock(GameSheet, ColNum / 2 * Gwidth, -1 * Gwidth, Gwidth, 1, 1); Wplane.Show(); CurrentBlock.Show(); return(Args); }
private void GameTimer_Tick(object sender, EventArgs e) { if (!Wplane.HasPoints(CurrentBlock.DownPoints(StepWise))) { CurrentBlock.Y += StepWise; } else { CurrentBlock.Y = (CurrentBlock.Y / Gwidth + 1) * Gwidth; Wplane.AddBlock(CurrentBlock); CurrentType = NextType; NextType = RandomNum.Next(7); CurrentBlock = new Gameblock(GameSheet, ColNum / 2 * Gwidth, -1 * Gwidth, Gwidth, CurrentType, 1); textBox1.Text = Heading + StringShow[NextType]; CurrentBlock.Show(); } }