Documentation ¶
Index ¶
- Constants
- func GameFrameToASCII(w io.Writer, g *engine.Game, gf *engine.GameFrame) error
- func GameFrameToGIF(w io.Writer, g *engine.Game, gf *engine.GameFrame) error
- func GameFramesToAnimatedGIF(w io.Writer, g *engine.Game, gameFrames []*engine.GameFrame, ...) error
- type Board
- type BoardSquare
- type BoardSquareContent
Constants ¶
View Source
const ( ASCIIEmpty = " " ASCIIFood = "*" ASCIISnakeHead = "H" ASCIISnakeBody = "O" ASCIISnakeTail = "T" )
View Source
const ( BoardSquareEmpty = 0 // Zero State (Default) BoardSquareFood = 1 BoardSquareSnakeBody = 2 BoardSquareSnakeHead = 3 BoardSquareSnakeTail = 4 BoardSquareDeadSnake = 5 )
View Source
const ( GIFFrameDelay = 8 GIFLoopDelay = 200 )
View Source
const ( BoardBorder = 2 BoardBorderBottom = 15 SquareSizePixels = 20 SquareBorderPixels = 1 SquareFoodRadius = SquareSizePixels / 3 )
Variables ¶
This section is empty.
Functions ¶
func GameFrameToASCII ¶
Types ¶
type Board ¶
type Board struct { Width int Height int Squares [][]BoardSquare }
type BoardSquare ¶
type BoardSquare struct { Content BoardSquareContent HexColor string SnakeType string Direction string Corner string }
type BoardSquareContent ¶
type BoardSquareContent int
Click to show internal directories.
Click to hide internal directories.