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: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Instance = &Game{}

Functions

func Down

func Down(steps int)

func DownLeft

func DownLeft(steps int)

func DownRight

func DownRight(steps int)

func Left

func Left(steps int)
func Right(steps int)

func Up

func Up(steps int)

func UpLeft

func UpLeft(steps int)

func UpRight

func UpRight(steps int)

Types

type Game

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

	SceneNames []string `toml:"scenes"`
	// contains filtered or unexported fields
}

func (*Game) Init

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

func (*Game) MarkError

func (g *Game) MarkError(err error)

func (*Game) MarkResult

func (g *Game) MarkResult()

func (*Game) PreCode

func (g *Game) PreCode() string

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 {
	*Scene

	Layout     string `toml:"layout"`
	Code       string `toml:"code"`
	Hint       string `toml:"hint"`
	SuccessMsg string `toml:"successMsg"`
	// contains filtered or unexported fields
}

type Scene

type Scene struct {
	*Game
	Sprites map[string]*Sprite `toml:"sprites"`

	BgColor1   string   `toml:"bgColor1"`
	BgColor2   string   `toml:"bgColor2"`
	LevelNames []string `toml:"levels"`
	// contains filtered or unexported fields
}

type Sprite

type Sprite struct {
	*Scene
	*common.Position

	Name      string `toml:"name"`
	Group     string `toml:"group"`
	Display   string `toml:"display"`
	Color     string `toml:"color"`
	BgColor   string `toml:"bgColor"`
	Foods     string `toml:"foods"`
	Forbbiden string `toml:"forbbiden"`
	Freinds   string `toml:"freinds"`
	Sprites   string `toml:"sprites"`

	IsPlayer bool `toml:"isPlayer"`
	CanMove  bool `toml:"canMove"`
	// contains filtered or unexported fields
}

func GetSprite

func GetSprite(y, x, i int) *Sprite

func (*Sprite) Down

func (s *Sprite) Down(steps int)

func (*Sprite) DownLeft

func (s *Sprite) DownLeft(steps int)

func (*Sprite) DownRight

func (s *Sprite) DownRight(steps int)

func (*Sprite) Left

func (s *Sprite) Left(steps int)

func (*Sprite) Right

func (s *Sprite) Right(steps int)

func (*Sprite) Up

func (s *Sprite) Up(steps int)

func (*Sprite) UpLeft

func (s *Sprite) UpLeft(steps int)

func (*Sprite) UpRight

func (s *Sprite) UpRight(steps int)

Jump to

Keyboard shortcuts

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