app

package
v0.0.0-...-a1e2222 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run()

Run is the game's entry-point

Types

type Cell

type Cell struct {
	Identified

	Value  int64
	Sprite *pixel.Sprite
	V      pixel.Vec
	Column *Column
	UID    int
}

Cell contains a board piece, which may be "empty" (i.e. with a Value of 0)

type Column

type Column struct {
	Identified

	Cells []*Cell
	Grid  *Grid
}

Column contains many Cells. Columns are vertical strips on the grid.

type Game

type Game struct {
	Assets *util.Assets
	Grid   *Grid
	Score  int64
	RNG    *rand.Rand
	Over   bool
	Win    *pixelgl.Window
}

Game contains the game's data

type Grid

type Grid struct {
	Background *pixel.Sprite
	Cells      []*Cell
	Columns    []*Column
}

Grid describes the game board. It contains Cells (which are pointers to the sub-items of each Column) and Columns.

type Identified

type Identified struct {
	ID  int
	BID int
}

Identified tags an item with an integer identifier

Jump to

Keyboard shortcuts

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