game

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SizeBeginner = Size{
		Rows:  9,
		Cols:  9,
		Mines: 10,
	}

	SizeIntermediate = Size{
		Rows:  16,
		Cols:  16,
		Mines: 40,
	}

	SizeExpert = Size{
		Rows:  16,
		Cols:  30,
		Mines: 99,
	}
)

Premade difficulty levels

Functions

This section is empty.

Types

type Game

type Game struct {
	Board       *fyne.Container
	Tiles       [][]*components.Tile
	Smiley      *components.SmileyMan
	MineCounter *components.MineCounter
	TimeCounter *components.TimeCounter

	OpenCount int
	WinCount  int
	IsRunning bool
	Size      Size

	Win fyne.Window
}

Game is a game damnit

func NewGame

func NewGame() *Game

NewGame creates a new game

func (*Game) Render

func (g *Game) Render()

Render the game

func (*Game) SeedGame

func (g *Game) SeedGame(size Size)

SeedGame creates a new game damnit

type Size

type Size struct {
	Rows  int
	Cols  int
	Mines int
}

Size stores the game dimensions

Jump to

Keyboard shortcuts

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