olded

package
v0.0.0-...-4ede3f3 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: BSD-2-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Import

func Import(dir string) (res []*game.World, err error)

Types

type Asset

type Asset struct {
	AssetInfo
	Pics map[ids.Pic]*Pic `json:"pics"`
	Last ids.Pic          `json:"-"`
}

func NewAsset

func NewAsset(info AssetInfo) *Asset

func (*Asset) GetPics

func (a *Asset) GetPics(is ...ids.Pic) []*Pic

func (*Asset) NewPic

func (a *Asset) NewPic() *Pic

type AssetInfo

type AssetInfo struct {
	Name string `json:"name"`
	Kind string `json:"kind"`
	geo.Dim
	Seq []*Seq `json:"seq"`
	Pal string `json:"pal"`
}

func (*AssetInfo) AddSeq

func (a *AssetInfo) AddSeq(name string) *Seq

func (*AssetInfo) GetSeq

func (a *AssetInfo) GetSeq(name string) *Seq

type Color

type Color uint32

func (Color) MarshalText

func (c Color) MarshalText() ([]byte, error)

func (*Color) UnmarshalText

func (c *Color) UnmarshalText(raw []byte) error

type Feat

type Feat struct {
	Name   string  `json:"name"`
	Colors []Color `json:"colors"`
}

type Level

type Level struct {
	LevelInfo
	grid.Tiles[lvl.Tile]
}

type LevelInfo

type LevelInfo struct {
	ID      ids.Lvl  `json:"id"`
	Name    string   `json:"name"`
	Tileset ids.Tset `json:"tileset"`
}

type Pal

type Pal struct {
	ID    ids.Pal `json:"id"`
	Name  string  `json:"name"`
	Kind  string  `json:"kind"`
	Feats []*Feat `json:"feat"`
}

func (*Pal) Feat

func (pal *Pal) Feat(name string) *Feat

type Pic

type Pic struct {
	ID ids.Pic `json:"id"`
	pix.Pix
}

type Seq

type Seq struct {
	Name string    `json:"name"`
	IDs  []ids.Pic `json:"ids,omitempty"`
}

Seq is a named sequence of frames for animation.

type TileInfo

type TileInfo struct {
	Tile  lvl.Tile `json:"tile"`
	Name  string   `json:"name"`
	Color uint32   `json:"color"`
	Block bool     `json:"block,omitempty"`
	Group string   `json:"group,omitempty"`
	Asset string   `json:"asset,omitempty"`
}

type Tset

type Tset struct {
	ID    ids.Tset   `json:"id"`
	Name  string     `json:"name"`
	Infos []TileInfo `json:"infos"`
}

type World

type World struct {
	WorldInfo
	Tileset *Tset              `json:"tileset"`
	Levels  map[ids.Lvl]*Level `json:"levels"`
}

type WorldInfo

type WorldInfo struct {
	Name    string `json:"name"`
	Tileset string `json:"tileset"`
	geo.Dim
	Levels []*LevelInfo `json:"levels"`
}

Jump to

Keyboard shortcuts

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