Documentation
¶
Index ¶
- Constants
- Variables
- func DrawCenteredText(screen *ebiten.Image, s string, font *text.GoTextFace, cx, cy int, ...)
- func Max(x, y int) int
- func Min(x, y int) int
- func NewBoard() map[Hex]*Cell
- type Cell
- type FractionalHex
- type Game
- func (g *Game) Draw(screen *ebiten.Image)
- func (g *Game) DrawHex(screen *ebiten.Image, hex Hex, cell *Cell)
- func (g *Game) DrawInfo(screen *ebiten.Image)
- func (g *Game) GetCell(hex Hex) *Cell
- func (g *Game) GetCellColor(cell *Cell) float32
- func (g *Game) GetCellUnderCursor() *Cell
- func (g *Game) GetHexUnderCursor() Hex
- func (g *Game) GetNeighbors(hex Hex) []*Cell
- func (g *Game) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int)
- func (g *Game) NextGen()
- func (g *Game) Start()
- func (g *Game) Stop()
- func (g *Game) Update() error
- func (g *Game) UpdateBoardState()
- type Hex
- type Layout
- type Orientation
- type Point
Constants ¶
View Source
const ( ScreenWidth = 1024 ScreenHeight = 1024 )
View Source
const ( ActionNone = iota ActionDraw ActionErase )
Variables ¶
View Source
var (
Image = ebiten.NewImage(3, 3)
)
Functions ¶
func DrawCenteredText ¶
Types ¶
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
func (*Cell) AliveNextGen ¶
type FractionalHex ¶
type FractionalHex struct {
// contains filtered or unexported fields
}
func (*FractionalHex) Round ¶
func (fh *FractionalHex) Round() Hex
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
func (*Game) GetCellColor ¶
func (*Game) GetCellUnderCursor ¶
func (*Game) GetHexUnderCursor ¶
func (*Game) GetNeighbors ¶
func (*Game) UpdateBoardState ¶
func (g *Game) UpdateBoardState()
type Hex ¶
type Hex struct {
// contains filtered or unexported fields
}
Hex space is represented by a cube coordinate system where q + r + s = 0
type Layout ¶
type Layout struct {
// contains filtered or unexported fields
}
func NewLayout ¶
func NewLayout(orientation *Orientation, size, origin Point) *Layout
func (*Layout) GetCorners ¶
func (*Layout) HexCornerOffset ¶
func (*Layout) HexToPixel ¶
func (*Layout) PixelToHex ¶
Click to show internal directories.
Click to hide internal directories.