public void gameTick(GraphicsWrapper g, Panel minigamePanel, Timer minigameTimer, uint minigameTime) { try { Random random = new Random(); tet.Drop(); if (isDropped == true) { tet = nexttet; nexttet = new Tetrominoe(); tet.Spawn(); isDropped = false; score += 10; } int j; for (j = 0; j < 10; j++) { if (droppedtetrominoeLocationGrid[0, j] == 1) { Misc.closeGameWindow.Invoke(); } } Input(); ClearBlock(); } catch (Exception ex) { if (ex.InnerException?.Message == "0717750f-3508-4bc2-841e-f3b077c676fe") { Misc.closeGameWindow.Invoke(); } else { Console.WriteLine(ex.ToString()); } } }
public void initGame(Panel minigamePanel, Timer minigameTimer) { rnd = new Random(); grid = new int[23, 10]; droppedtetrominoeLocationGrid = new int[23, 10]; isDropped = false; linesCleared = 0; score = 0; level = 1; nexttet = new Tetrominoe(); tet = nexttet; tet.Spawn(); nexttet = new Tetrominoe(); }