Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PSNB92/Tetris
/ functions
Functions
57 in github.com/PSNB92/Tetris
⨍
Functions
57
◇
Types & classes
5
↓ 15 callers
Method
getDimension
Gets the dimension of this type. @return The dimension.
src/org/psnbtech/TileType.java:292
↓ 9 callers
Method
isTile
Checks to see if the given coordinates and rotation contain a tile. @param x The x coordinate of the tile. @param y The y coordinate of the tile. @par
src/org/psnbtech/TileType.java:337
↓ 6 callers
Method
isValidAndEmpty
Determines whether or not a piece can be placed at the coordinates. @param type THe type of piece to use. @param x The x coordinate of the piece. @par
src/org/psnbtech/BoardPanel.java:145
↓ 5 callers
Method
setCyclesPerSecond
Sets the number of cycles that elapse per second. @param cyclesPerSecond The number of cycles per second.
src/org/psnbtech/Clock.java:50
↓ 4 callers
Method
getTopInset
The left inset is represented by the number of empty rows on the top side of the array for the given rotation. @param rotation The rotation. @return T
src/org/psnbtech/TileType.java:389
↓ 4 callers
Method
reset
Resets the clock stats. Elapsed cycles and cycle excess will be reset to 0, the last update time will be reset to the current time, and the paused fla
src/org/psnbtech/Clock.java:59
↓ 3 callers
Method
drawTile
Draws a tile onto the board. @param type The type of tile to draw. @param x The column. @param y The row. @param g The graphics object.
src/org/psnbtech/BoardPanel.java:397
↓ 3 callers
Method
getBaseColor
Gets the base color of this type. @return The base color.
src/org/psnbtech/TileType.java:268
↓ 3 callers
Method
getLeftInset
The left inset is represented by the number of empty columns on the left side of the array for the given rotation. @param rotation The rotation. @retu
src/org/psnbtech/TileType.java:347
↓ 3 callers
Method
isNewGame
Checks to see whether or not we're on a new game. @return Whether or not this is a new game.
src/org/psnbtech/Tetris.java:497
↓ 3 callers
Method
setPaused
Pauses or unpauses the clock. While paused, a clock will not update elapsed cycles or cycle excess, though the {@code update} method should still be c
src/org/psnbtech/Clock.java:93
↓ 2 callers
Method
getBottomInset
The botom inset is represented by the number of empty rows on the bottom side of the array for the given rotation. @param rotation The rotation. @retu
src/org/psnbtech/TileType.java:410
↓ 2 callers
Method
getCurrentTime
Calculates the current time in milliseconds using the computer's high resolution clock. This is much more reliable than {@code System.getCurrentTimeMi
src/org/psnbtech/Clock.java:137
↓ 2 callers
Method
getDarkColor
Gets the dark shading color of this type. @return The dark color.
src/org/psnbtech/TileType.java:284
↓ 2 callers
Method
getLightColor
Gets the light shading color of this type. @return The light color.
src/org/psnbtech/TileType.java:276
↓ 2 callers
Method
getRightInset
The right inset is represented by the number of empty columns on the left side of the array for the given rotation. @param rotation The rotation. @ret
src/org/psnbtech/TileType.java:368
↓ 2 callers
Method
getTile
Gets a tile by it's column and row. @param x The column. @param y The row. @return The tile.
src/org/psnbtech/BoardPanel.java:275
↓ 2 callers
Method
isGameOver
Checks to see whether or not the game is over. @return Whether or not the game is over.
src/org/psnbtech/Tetris.java:489
↓ 2 callers
Method
isOccupied
Checks to see if the tile is already occupied. @param x The x coordinate to check. @param y The y coordinate to check. @return Whether or not the tile
src/org/psnbtech/BoardPanel.java:255
↓ 2 callers
Method
rotatePiece
Attempts to set the rotation of the current piece to newRotation. @param newRotation The rotation of the new peice.
src/org/psnbtech/Tetris.java:428
↓ 2 callers
Method
setTile
Sets a tile located at the desired column and row. @param x The column. @param y The row. @param type The value to set to the tile to.
src/org/psnbtech/BoardPanel.java:265
↓ 2 callers
Method
spawnPiece
Spawns a new piece and resets our piece's variables to their default values.
src/org/psnbtech/Tetris.java:403
↓ 1 callers
Method
addPiece
Adds a piece to the game board. Note: Doesn't check for existing pieces, and will overwrite them if they exist. @param type The type of piece to place
src/org/psnbtech/BoardPanel.java:181
↓ 1 callers
Method
checkLine
Checks whether or not {@code row} is full. @param line The row to check. @return Whether or not this row is full.
src/org/psnbtech/BoardPanel.java:225
↓ 1 callers
Method
checkLines
Checks the board to see if any lines have been cleared, and removes them from the game. @return The number of lines that were cleared.
src/org/psnbtech/BoardPanel.java:201
↓ 1 callers
Method
clear
Resets the board and clears away any tiles.
src/org/psnbtech/BoardPanel.java:125
↓ 1 callers
Method
drawTile
Draws a tile onto the preview window. @param type The type of tile to draw. @param x The x coordinate of the tile. @param y The y coordinate of the ti
src/org/psnbtech/SidePanel.java:200
↓ 1 callers
Method
getCols
Gets the number of columns in this piece. (Only valid when rotation is 0 or 2, but it's fine since this is only used for the preview which uses rotati
src/org/psnbtech/TileType.java:326
↓ 1 callers
Method
getLevel
Gets the current level. @return The level.
src/org/psnbtech/Tetris.java:513
↓ 1 callers
Method
getNextPieceType
Gets the next type of piece we're using. @return The next piece.
src/org/psnbtech/Tetris.java:529
↓ 1 callers
Method
getPieceCol
Gets the column of the current piece. @return The column.
src/org/psnbtech/Tetris.java:537
↓ 1 callers
Method
getPieceRotation
Gets the rotation of the current piece. @return The rotation.
src/org/psnbtech/Tetris.java:553
↓ 1 callers
Method
getPieceRow
Gets the row of the current piece. @return The row.
src/org/psnbtech/Tetris.java:545
↓ 1 callers
Method
getPieceType
Gets the current type of piece we're using. @return The piece type.
src/org/psnbtech/Tetris.java:521
↓ 1 callers
Method
getRows
Gets the number of rows in this piece. (Only valid when rotation is 0 or 2, but it's fine since this is only used for the preview which uses rotation
src/org/psnbtech/TileType.java:317
↓ 1 callers
Method
getScore
Gets the current score. @return The score.
src/org/psnbtech/Tetris.java:505
↓ 1 callers
Method
getSpawnColumn
Gets the spawn column of this type. @return The spawn column.
src/org/psnbtech/TileType.java:300
↓ 1 callers
Method
getSpawnRow
Gets the spawn row of this type. @return The spawn row.
src/org/psnbtech/TileType.java:308
↓ 1 callers
Method
hasElapsedCycle
Checks to see if a cycle has elapsed for this clock yet. If so, the number of elapsed cycles will be decremented by one. @return Whether or not a cycl
src/org/psnbtech/Clock.java:111
↓ 1 callers
Method
isPaused
Checks to see if the clock is currently paused. @return Whether or not this clock is paused.
src/org/psnbtech/Clock.java:101
↓ 1 callers
Method
renderGame
Forces the BoardPanel and SidePanel to repaint.
src/org/psnbtech/Tetris.java:377
↓ 1 callers
Method
resetGame
Resets the game variables to their default values at the start of a new game.
src/org/psnbtech/Tetris.java:386
↓ 1 callers
Method
startGame
Starts the game running. Initializes everything and enters the game loop.
src/org/psnbtech/Tetris.java:267
↓ 1 callers
Method
update
Updates the clock stats. The number of elapsed cycles, as well as the cycle excess will be calculated only if the clock is not paused. This method sho
src/org/psnbtech/Clock.java:72
↓ 1 callers
Method
updateGame
Updates the game and handles the bulk of it's logic.
src/org/psnbtech/Tetris.java:322
Method
BoardPanel
Crates a new GameBoard instance. @param tetris The Tetris instance to use.
src/org/psnbtech/BoardPanel.java:114
Method
Clock
Creates a new clock and sets it's cycles-per-second. @param cyclesPerSecond The number of cycles that elapse per second.
src/org/psnbtech/Clock.java:41
Method
SidePanel
Creates a new SidePanel and sets it's display properties. @param tetris The Tetris instance to use.
src/org/psnbtech/SidePanel.java:103
Method
Tetris
Creates a new Tetris instance. Sets up the window's properties, and adds a controller listener.
src/org/psnbtech/Tetris.java:120
Method
TileType
Creates a new TileType. @param color The base color of the tile. @param dimension The dimensions of the tiles array. @param cols The number of columns
src/org/psnbtech/TileType.java:251
Method
isPaused
Checks to see whether or not the game is paused. @return Whether or not the game is paused.
src/org/psnbtech/Tetris.java:481
Method
keyPressed
(KeyEvent e)
src/org/psnbtech/Tetris.java:146
Method
keyReleased
(KeyEvent e)
src/org/psnbtech/Tetris.java:235
Method
main
Entry-point of the game. Responsible for creating and starting a new game instance. @param args Unused.
src/org/psnbtech/Tetris.java:562
Method
paintComponent
(Graphics g)
src/org/psnbtech/BoardPanel.java:279
Method
paintComponent
(Graphics g)
src/org/psnbtech/SidePanel.java:110
Method
peekElapsedCycle
Checks to see if a cycle has elapsed for this clock yet. Unlike {@code hasElapsedCycle}, the number of cycles will not be decremented if the number of
src/org/psnbtech/Clock.java:126