gamedata

package
v0.0.0-...-a4c0b9d Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseTileset

func ParseTileset(jsonData []byte) (*tiled.Tileset, error)

Types

type InstrumentKind

type InstrumentKind int
const (
	BassInstrument InstrumentKind = iota
	DrumInstrument
	KeyboardInstrument
	BrassInstrument
	StringInstrument
	OtherInstrument
	AnyInstrument
)

type InstrumentSettings

type InstrumentSettings struct {
	Function       string  `json:"function"`
	PeriodFunction string  `json:"period_function"`
	Volume         float64 `json:"volume"`
	InstrumentName string  `json:"instrument_name"`
	Enabled        bool    `json:"enabled"`
}

type LevelBonusObjectives

type LevelBonusObjectives struct {
	MaxInstruments int

	ForbiddenFuncs []string

	AllTargets    bool
	AvoidOptional bool
	AvoidPenalty  bool
}

type LevelData

type LevelData struct {
	Name string

	Targets []Target

	ActNumber     int
	MissionNumber int

	MaxInstruments int
	Description    string

	Solution Track

	Bonus LevelBonusObjectives
}

func ParseLevel

func ParseLevel(tileset *tiled.Tileset, scaler *PlotScaler, jsonData []byte) (*LevelData, error)

type Mode

type Mode int
const (
	MissionMode Mode = iota
	SandboxMode
)

type PlotScaler

type PlotScaler struct {
	Factor float64
	Offset gmath.Vec
}

func (*PlotScaler) ScalePos

func (s *PlotScaler) ScalePos(pos gmath.Vec) gmath.Vec

func (*PlotScaler) ScaleXY

func (s *PlotScaler) ScaleXY(x, y float64) gmath.Vec

func (*PlotScaler) TranslateTiledPos

func (s *PlotScaler) TranslateTiledPos(tileset *tiled.Tileset, pos gmath.Vec) gmath.Vec

type Shape

type Shape int
const (
	ShapeCircle Shape = iota
	ShapeSquare
	ShapeTriangle
	ShapeHexagon
	ShapeStar
	ShapeCross
	ShapeBonus
)

func InstrumentShape

func InstrumentShape(kind InstrumentKind) Shape

func (Shape) String

func (i Shape) String() string

type Target

type Target struct {
	Pos gmath.Vec

	Instrument InstrumentKind

	Outline bool

	Size TargetSize
}

type TargetSize

type TargetSize int
const (
	SmallTarget TargetSize = iota
	NormalTarget
	BigTarget
)

type Track

type Track struct {
	Name string `json:"name"`

	Date time.Time `json:"date"`

	Instruments []InstrumentSettings `json:"instruments"`

	Slot int
}

func DiscoverTracks

func DiscoverTracks(ctx *ge.Context) []Track

func (*Track) FileName

func (t *Track) FileName() string

func (*Track) IsEmpty

func (t *Track) IsEmpty() bool

Jump to

Keyboard shortcuts

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