//Constructor initialiseert objecten en geeft ze juiste posities. public PlayingGrid(Vector2 position, int width, int height) : base(position, width, height) { Current = new Tetromino(); Next = new Tetromino().GenerateRandom(); Next.GenerateRandom(); Score = new ScoreGameObject(new Vector2(10, 10), "Comic Sans"); resetTetromino(); }
//Zet de huidge Tetromino bovenaan en genereer een nieuwe Tetromino. public void resetTetromino() { Current = Next; Current.Position = new Point(Width / 2 - 1, 0); Next = new Tetromino().GenerateRandom(); Next.Position = new Point(Width + 1, 1); Next.GenerateRandom(); Score.blockCount++; }