Versions in this module Expand all Collapse all v0 v0.3.8 Sep 10, 2020 v0.3.7 May 25, 2020 v0.3.6 Dec 21, 2019 v0.3.5 Oct 21, 2019 v0.3.4 Oct 21, 2019 v0.3.3 Sep 24, 2019 v0.3.2 Sep 8, 2019 Changes in this version + func CenterAlignString(input string, width int) string + func ListenEvents(game *Game, inputEvent chan termbox.Key, resizeEvent chan Size) type Game + func (game *Game) Resize() + func (game *Game) Restart() type Level + func (level *Level) IsWall(pos Position) bool + type Score struct + func NewScore() *Score + func (score *Score) GetHighscore() int + func (score *Score) GetScore() int + func (score *Score) IncrementScore() + func (score *Score) SetScore(newScore int) v0.3.1 Jul 19, 2019 v0.3.0 Jul 19, 2019 Changes in this version + func ListenKeyboard(event chan termbox.Key) + type Apple struct + func NewApple(position Position) *Apple + type Direction struct + X int + Y int + func GetInputDirection(key termbox.Key) Direction + func (dir Direction) Equals(x int, y int) bool + func (dir Direction) Zero() bool + type Game struct + func NewGame() *Game + func (game *Game) IncrementScore() + func (game *Game) Start() + type Level struct + func NewLevel(game *Game, size Size) *Level + func (level *Level) EatApple() + func (level *Level) GetRandomPosition() Position + func (level *Level) Render() string + func (level *Level) Update() + type Position struct + X int + Y int + func (pos Position) Equals(x int, y int) bool + func (pos Position) Zero() bool + type Size struct + Height int + Width int + type Snake struct + func NewSnake(position Position, direction Direction) *Snake + func (snake *Snake) CheckHitbox(position Position) bool + func (snake *Snake) GetHead() Position + func (snake *Snake) IncrementSize() + func (snake *Snake) Move() + func (snake *Snake) UpdateDirection(direction Direction)