public void Drop(Game game) { // get coordinates float[] x = new float[4]; float[] y = new float[4]; ToCoordinates(ref x, ref y); for (int i = 0; i < 4; i++) { if ((x[i] < Game.Width) && (y[i] < Game.Height)) { game.Block[(int)x[i], (int)(y[i])] = m_nColor; } } game.Score += ((24 + (3 * game.Level)) - m_nFreefalls); game.CheckLines(); }
public void Drop(Game game) { // get coordinates float[] x = new float[4]; float[] y = new float[4]; ToCoordinates(ref x, ref y); for (int i = 0; i < 4; i++) { if ((x[i] < Game.Width) && (y[i] < Game.Height)) { game.Block[(int)x[i], (int)(y[i])] = m_nColor; } } game.Score += ((24 + (3 * game.Level)) - m_nFreefalls); game.CheckLines(); }
private static void TimerCallback(Object o) { if (play.isCurrentPieceFallen()) { int lines = play.CheckLines(); if (lines > 0) { play.SetScore(lines); } play.GetCurrentPiece(); } else { play.Down(); Show(); } // Display the date/time when this method got called. Console.WriteLine("In TimerCallback: " + DateTime.Now); // Force a garbage collection to occur for this demo. GC.Collect(); }