console

package
v0.0.0-...-ce9d6f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2021 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const N = 5

add food every N moves

Variables

This section is empty.

Functions

This section is empty.

Types

type Boundary

type Boundary struct {
	TopLeft     core.Coord
	BottomRight core.Coord
}

func (Boundary) Contains

func (boundary Boundary) Contains(coord core.Coord) bool

type GameUI

type GameUI struct {
	Snakes map[peer.ID]*Snake
	Food   map[int]core.Coord

	AliveSnakes int

	Over       bool
	Successful bool
	WinnerID   peer.ID
	// contains filtered or unexported fields
}

func NewGame

func NewGame(gi *game.GameInstance) *GameUI

func (*GameUI) RunGame

func (g *GameUI) RunGame(seed int64)

type GatherUI

type GatherUI struct {
	// contains filtered or unexported fields
}

func NewGatherUI

func NewGatherUI(h *snake.Node) *GatherUI

func (*GatherUI) Run

func (g *GatherUI) Run() error

type Snake

type Snake struct {
	Alive bool
	Body  []core.Coord
	Head  core.Coord
	Style tcell.Style
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL