8: Tetromino Last updated Dec 1, 2020 Save as PDF Index Front Matter Page ID13610 ( \newcommand{\kernel}{\mathrm{null}\,}\) 8.1: How to Play Tetromino8.2: Some Tetromino Nomenclature8.3: Source Code to Tetromino8.4: The Usual Setup Code8.5: Setting up Timing Constants for Holding Down Keys8.6: More Setup Code8.7: Setting Up the Piece Templates8.8: Splitting a “Line of Code” Across Multiple Lines8.9: The main() Function8.10: The Start of a New Game8.11: The Game Loop8.12: The Event Handling Loop8.13: Pausing the Game8.14: Using Movement Variables to Handle User Input8.15: Checking if a Slide or Rotation is Valid8.16: Finding the Bottom8.17: Moving by Holding Down the Key8.18: Letting the Piece “Naturally” Fall8.19: Drawing Everything on the Screen8.20: makeTextObjs(), A Shortcut Function for Making Text8.21: The Same Old terminate() Function8.22: Waiting for a Key Press Event with the checkForKeyPress() Function8.23: showTextScreen(), A Generic Text Screen Function8.24: The checkForQuit() Function8.25: The calculateLevelAndFallFreq() Function8.26: Generating Pieces with the getNewPiece() Function8.27: Adding Pieces to the Board Data Structure8.28: Creating a New Board Data Structure8.29: The isOnBoard() and isValidPosition() Functions8.30: Checking for, and Removing, Complete Lines8.31: Convert from Board Coordinates to Pixel Coordinates8.32: Drawing a Box on the Board or Elsewhere on the Screen8.33: Drawing Everything to the Screen8.34: Drawing the Score and Level Text8.35: Drawing a Piece on the Board or Elsewhere on the Screen8.36: Drawing the “Next” Piece8.37: Summary