twenty48

package
v1.4.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScreenWidth  = 210
	ScreenHeight = 300
)

Variables

This section is empty.

Functions

func MoveTiles

func MoveTiles(tiles map[*Tile]struct{}, size int, dir Dir) bool

Types

type Board

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

func NewBoard

func NewBoard(size int) (*Board, error)

func (*Board) Draw

func (b *Board) Draw(boardImage *ebiten.Image) error

func (*Board) Move

func (b *Board) Move(dir Dir) error

func (*Board) Size

func (b *Board) Size() (int, int)

func (*Board) Update

func (b *Board) Update(input *Input) error

type Dir

type Dir int
const (
	DirUp Dir = iota
	DirRight
	DirDown
	DirLeft
)

func (Dir) String

func (d Dir) String() string

func (Dir) Vector

func (d Dir) Vector() (x, y int)

type Game

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

func NewGame

func NewGame() (*Game, error)

func (*Game) Draw

func (g *Game) Draw(screen *ebiten.Image) error

func (*Game) Update

func (g *Game) Update() error

type Input

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

func NewInput

func NewInput() *Input

func (*Input) Dir

func (i *Input) Dir() (Dir, bool)

func (*Input) Update

func (i *Input) Update() error

type Tile

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

func NewTile

func NewTile(value int, x, y int) *Tile

func (*Tile) Draw

func (t *Tile) Draw(boardImage *ebiten.Image) error

func (*Tile) IsMoving

func (t *Tile) IsMoving() bool

func (*Tile) NextPos

func (t *Tile) NextPos() (int, int)

func (*Tile) NextValue

func (t *Tile) NextValue() int

func (*Tile) Pos

func (t *Tile) Pos() (int, int)

func (*Tile) Update

func (t *Tile) Update() error

func (*Tile) Value

func (t *Tile) Value() int

type TileData

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

Jump to

Keyboard shortcuts

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