public TBlock(System.Windows.Controls.Canvas gameCanvas, GameArray gameArray) { this.Type = "T"; this.CanMove = true; this.GameArray = gameArray; this.GameCanvas = gameCanvas; this.XCoord = 60; this.YCoord = 20; this.Orientation = 0; }
public void newGame() { //Resets all necessary variables, then starts a new game. gameCanvas.Children.Clear(); nextBlockCanvas.Children.Clear(); this.logic = new GameLogic(scoreBox, levelBox, rowsBox); this.logic.initializeBoxes(); gameArray = new GameArray(gameCanvas, this.logic); tetriminoFactory = new TetriminoFactory(gameCanvas, gameArray); gameStarted = true; CurrentBlock = tetriminoFactory.getNewBlock(); NextBlock = tetriminoFactory.getNewBlock(); drawNext(); CurrentBlock.Move(CurrentBlock.XCoord, CurrentBlock.YCoord, CurrentBlock.Orientation); StartTimer(); }
public TetriminoFactory(System.Windows.Controls.Canvas gameCanvas, GameArray gameArray) { this.GameCanvas = gameCanvas; this.GameArray = gameArray; }