entities

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const PieceCount = 5

PieceCount is the total amount of pieces

Variables

This section is empty.

Functions

func PieceSize

func PieceSize(points []image.Point) image.Point

func PieceTiles

func PieceTiles(index int) []image.Point

func TileSize

func TileSize(boardSize int) int

Types

type Board

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

func NewBoard

func NewBoard(pieces [PieceCount]*Piece, x, y, w, h int) *Board

func (*Board) AllTilesFilled added in v0.4.0

func (b *Board) AllTilesFilled(pieces [PieceCount]*Piece) bool

func (*Board) Draw

func (b *Board) Draw(dst *ebiten.Image)

func (*Board) Position

func (b *Board) Position() image.Point

func (*Board) Rect

func (b *Board) Rect() image.Rectangle

func (*Board) TileSize

func (b *Board) TileSize() int

type Dialog added in v0.4.2

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

func (*Dialog) Draw added in v0.4.2

func (d *Dialog) Draw(dst *ebiten.Image)

func (*Dialog) Update added in v0.4.2

func (d *Dialog) Update(screenSize image.Point)

type PauseDialog added in v0.4.2

type PauseDialog struct {
	*Dialog
}

func NewPauseDialog added in v0.4.2

func NewPauseDialog(screenSize image.Point) (*PauseDialog, error)

func (*PauseDialog) SetOnBack added in v0.4.2

func (p *PauseDialog) SetOnBack(pressed func())

func (*PauseDialog) SetOnResume added in v0.4.2

func (p *PauseDialog) SetOnResume(pressed func())

type Piece

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

func NewPiece

func NewPiece(pieces *ebiten.Image, tileSize, index, x, y int) *Piece

func (*Piece) Draw

func (p *Piece) Draw(dst *ebiten.Image)

func (*Piece) GetPosition

func (p *Piece) GetPosition() image.Point

func (*Piece) Index

func (p *Piece) Index() int

func (*Piece) Rect added in v0.4.0

func (p *Piece) Rect() image.Rectangle

func (*Piece) SetPosition

func (p *Piece) SetPosition(x, y int)

func (*Piece) Size

func (p *Piece) Size() image.Point

func (*Piece) Update

func (p *Piece) Update()

type WinDialog added in v0.4.0

type WinDialog struct {
	*Dialog
}

func NewWinDialog added in v0.4.0

func NewWinDialog(total time.Duration, screenSize image.Point) (*WinDialog, error)

func (*WinDialog) SetOnBack added in v0.4.0

func (d *WinDialog) SetOnBack(pressed func())

func (*WinDialog) SetOnNext added in v0.4.0

func (d *WinDialog) SetOnNext(pressed func())

Jump to

Keyboard shortcuts

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