MCPcopy Create free account

hub / github.com/cespare/go-tetris / functions

Functions39 in github.com/cespare/go-tetris

↓ 23 callersFunctionprintBorderCharacter
Print a box-drawing border character.
tetris/drawing.go:68
↓ 7 callersMethodplus
Add two vectors.
tetris/vector.go:9
↓ 5 callersMethodDrawDynamic
Draw the dynamic parts of the game interface (the board, the next piece preview pane, and the score). The static parts should be drawn with the drawS
tetris/game.go:291
↓ 4 callersFunctiondrawStaticBoardParts
* // See http://en.wikipedia.org/wiki/Box-drawing_character for unicode characters. */
tetris/drawing.go:94
↓ 4 callersFunctionprintString
Print a message in white text.
tetris/drawing.go:54
↓ 4 callersFunctionsetBoardCell
A board cell is two terminal cells wide, for squaritude. Only need to set the whole bg color (for filling in a cell).
tetris/drawing.go:48
↓ 4 callersFunctionsetCell
Our own wrapper around termbox.SetCell which knows the background color we're using.
tetris/drawing.go:42
↓ 3 callersMethodGeneratePiece
Randomly choose a new game piece from among the the available pieces.
tetris/game.go:197
↓ 3 callersMethodMove
Attempt to move.
tetris/game.go:252
↓ 3 callersMethodcurrentPieceInCollision
Finds whether the current piece is in collision (going over the edge, or overlapping existing occupied blocks). This is useful for testing for collisi
tetris/board.go:34
↓ 3 callersMethodinstance
Find the current PieceInstance of this piece.
tetris/piece.go:20
↓ 3 callersMethodstartTicker
Start up the ticker with the appropriate interval based on the current score.
tetris/game.go:50
↓ 2 callersMethodDrawPauseScreen
Draw the pause screen, hiding the game board and next piece.
tetris/game.go:352
↓ 2 callersMethodPauseToggle
Pause or unpause the game, depending on game.paused.
tetris/game.go:339
↓ 2 callersMethodanchor
Anchor the current piece to the board, clears lines, increments the score, and generate a new piece. Sets the 'game over' state if the new piece overl
tetris/game.go:203
↓ 2 callersMethodcontains
Returns whether a vector is a member of the color map.
tetris/board.go:11
↓ 2 callersMethodmoveIfPossible
Moves the current piece to another location, if possible. The current piece is updated if this is successful; otherwise, the piece is left unmoved. Th
tetris/board.go:49
↓ 2 callersMethodrowComplete
Check whether a horizontal row is complete.
tetris/board.go:68
↓ 2 callersMethodstopTicker
Stop the game ticker. This stops automatic advancement of the piece.
tetris/game.go:60
↓ 2 callersFunctionwaitForUserEvent
A blocking function that waits for user input and then emits the appropriate GameEvent.
tetris/game.go:151
↓ 1 callersMethodCellColor
Finds the color of a particular board cell. It returns the background color if the cell is empty.
tetris/board.go:119
↓ 1 callersMethodDrawGameOver
Draw the "GAME OVER" overlay on top of the game interface.
tetris/game.go:371
↓ 1 callersFunctionNewGame
Initialize a new game, ready to be started with Start().
tetris/game.go:35
↓ 1 callersMethodQuickDrop
Drop the piece all the way and anchor it.
tetris/game.go:272
↓ 1 callersMethodRotate
Rotates the current game piece, if possible.
tetris/game.go:281
↓ 1 callersMethodStart
Start running the game. It will continue indefinitely until the user exits.
tetris/game.go:80
↓ 1 callersMethodclearRows
Clear any complete rows and move the above blocks down. Returns the number of cleared rows.
tetris/board.go:95
↓ 1 callersMethodclearedRows
Find all completed rows.
tetris/board.go:108
↓ 1 callersMethodcollapseRow
Clear a single row and move every above cell down.
tetris/board.go:78
↓ 1 callersFunctiondrawDigitAsAscii
Print the current score in big ascii art digits
tetris/drawing.go:85
↓ 1 callersMethodequals
Determine whether two vectors are the same.
tetris/vector.go:14
↓ 1 callersMethodmergeCurrentPiece
Merge the blocks of the current piece into the game board and remove the current piece.
tetris/board.go:60
↓ 1 callersFunctionnewBoard
Create a new empty tetris board with no current piece.
tetris/board.go:25
↓ 1 callersFunctionprintStringVertical
Print a message vertically in white text.
tetris/drawing.go:61
↓ 1 callersMethodrotate
Go to the next rotation.
tetris/piece.go:25
↓ 1 callersFunctiontetrisPieces
This has all the hard-coded tetris pieces. TODO: It might be nice to have a way to parse these from a configuration file. Maybe the format could look
tetris/piece.go:49
↓ 1 callersMethodunrotate
Go to the previous rotation.
tetris/piece.go:30
Functionmain
()
go-tetris.go:11
FunctionwaitForTick
A blocking function that waits on a ticker and then emits a MoveDown event.
tetris/game.go:145