pkg

package
v0.0.0-...-02c39c9 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Instace = &Game{}

Functions

This section is empty.

Types

type Block

type Block struct {
	Color string
}

type Game

type Game struct {
	*tea.Program
	*yaq.Base

	Sprites map[string]*Sprite `toml:"sprites"`

	Levels []string `toml:"levels"`

	Rows    int `toml:"rows"`
	Columns int `toml:"columns"`
	// contains filtered or unexported fields
}

func (*Game) Init

func (g *Game) Init() tea.Cmd

func (*Game) Update

func (g *Game) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Game) View

func (g *Game) View() string

type Level

type Level struct {
	*Game

	Layout     string `toml:"layout"`
	Code       string `toml:"code"`
	Hint       string `toml:"hint"`
	SuccessMsg string `toml:"successMsg"`
	Name       string
	Grid       [][]*Block
	// contains filtered or unexported fields
}

func (*Level) View

func (l *Level) View() string

type Pen

type Pen struct {
	*Game
	*common.Position
	Color   string `toml:"color"`
	Display string `toml:"display"`
	IsUp    bool   `toml:"isUp"`
}

func (*Pen) Down

func (p *Pen) Down(steps int)

func (*Pen) DownLeft

func (p *Pen) DownLeft(steps int)

func (*Pen) DownRight

func (p *Pen) DownRight(steps int)

func (*Pen) Left

func (p *Pen) Left(steps int)

func (*Pen) Right

func (p *Pen) Right(steps int)

func (*Pen) SetStateUp

func (p *Pen) SetStateUp(up bool)

func (*Pen) Up

func (p *Pen) Up(steps int)

func (*Pen) UpLeft

func (p *Pen) UpLeft(steps int)

func (*Pen) UpRight

func (p *Pen) UpRight(steps int)

type Sprite

type Sprite struct {
	*Block
	*Pen
	Sprites string `toml:"sprites"`
	IsPen   bool   `toml:"isPen"`
}

Jump to

Keyboard shortcuts

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