public GameplayScreen() { TransitionOnTime = TimeSpan.FromSeconds(1.5); TransitionOffTime = TimeSpan.FromSeconds(0.5); #if XBOX scale = 0.5f; x = 245; y = 150; #elif WINDOWS scale = 1.0f; x = 135; y = 150; #endif sounds = new ReachSoundManager(0.50f, 0.50f); scoreKeeper = new Scoring(x, 0, sounds); board = new Board(10, 22, scale, new Vector2(x, y), scoreKeeper); nextPiece = new Piece(board); swapPiece = new Piece(board); currentPiece = new Piece(board, swapPiece, sounds, scoreKeeper); theGenerator = new RandomGenerator(); pieceList.Add(sounds); pieceList.Add(scoreKeeper); pieceList.Add(board); pieceList.Add(theGenerator); Initialize(); }
public Piece(Board theBoard, Piece swapPiece, ReachSoundManager sounds, Scoring scoreKeeper) : this(theBoard) { this.swapPiece = swapPiece; Sounds = sounds; ScoreKeeper = scoreKeeper; Drop = new Board.ScoringEvent(ScoreKeeper.Drop); TimeSinceLastAutoDrop = 0; }
public Board(int x, int y, float scale, Vector2 boardLoc, Scoring scoreKeeper) { Width = x; Height = y; Scale = scale; ScoreKeeper = scoreKeeper; this.boardLoc = boardLoc; IsMoveMade = false; Offset = new Vector2(boardLoc.X - 30.0f * scale, boardLoc.Y - 90.0f * scale);//60.0f * scale); Move = new ScoringEvent(ScoreKeeper.LastMove); gameBoard = new Block[Width, Height]; }