private void pressArrow(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.Up: controller.ActionPerformed(TwoZeroFourEightController.UP); break; case Keys.Left: controller.ActionPerformed(TwoZeroFourEightController.LEFT); break; case Keys.Right: controller.ActionPerformed(TwoZeroFourEightController.RIGHT); break; case Keys.Down: controller.ActionPerformed(TwoZeroFourEightController.DOWN); break; } lblDisplay.Text = (model.GetScore()).ToString(); if (model.GameOver()) { lblSta.Text = (model.GameOver() ? "Game Over" : lblSta.Text); GameOverScreen end = new GameOverScreen(lblDisplay.Text); end.Show(); } }
public void Notify(Model m) { UpdateBoard(((TwoZeroFourEightModel)m).GetBoard()); label1.Text = "SCORE" + " " + m.GetScore(); if (m.GetOver() && Full(m)) { label3.Text = "GAME OVER"; } }