defs

package
v0.0.0-...-8613cf7 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSuchCategory   = errors.New("no such category")
	ErrMissingDirectory = errors.New("missing directory")
)
View Source
var CELL_SCALE = 16
View Source
var LOAD_TICKS = 120
View Source
var MAX_HISTORY = 10

Functions

func HasCollision

func HasCollision(a, b Thingi, move *Move) bool

Types

type Action

type Action struct {
	Thing  Thingi
	Move   *Move
	Glitch bool
}

type Enemy

type Enemy struct {
	*Thing
	// contains filtered or unexported fields
}

type Level

type Level struct {
	LevelNumber int
	// contains filtered or unexported fields
}

func LevelFromText

func LevelFromText(levelNumber int, r *Resources, mainAudio *audio.Player) (*Level, error)

func NewLevel

func NewLevel(name string) *Level

func (*Level) Draw

func (l *Level) Draw(screen *ebiten.Image)

func (*Level) Update

func (l *Level) Update() int

type Move

type Move struct {
	// contains filtered or unexported fields
}

type Player

type Player struct {
	Thing
}

func NewPlayer

func NewPlayer(x, y float64, t *Thing) *Player

func (*Player) Draw

func (p *Player) Draw(screen *ebiten.Image)

func (*Player) GetAction

func (p *Player) GetAction() *Action

func (*Player) Update

func (p *Player) Update() *Action

type Resources

type Resources struct {
	// contains filtered or unexported fields
}

func InitResources

func InitResources(embedFS embed.FS) *Resources

func (*Resources) GetLevel

func (r *Resources) GetLevel(name string) string

func (*Resources) GetMusic

func (r *Resources) GetMusic(name string) vorbis.Stream

func (*Resources) GetSprite

func (r *Resources) GetSprite(name string) *ebiten.Image

func (*Resources) GetThing

func (r *Resources) GetThing(roon rune) *Thing

func (*Resources) Load

func (r *Resources) Load() error

type Thing

type Thing struct {
	Name        string  `yaml:"name"`
	Symbol      string  `yaml:"symbol"`
	Enemy       bool    `yaml:"enemy"`
	Block       bool    `yaml:"block"`
	BlockGlitch bool    `yaml:"blockGlitch"`
	Speed       float64 `yaml:"speed"`
	MaxEnergy   int     `yaml:"energy"`
	Exit        bool    `yaml:"exit"`
	Behavior    string  `yaml:"behavior"`
	// contains filtered or unexported fields
}

func ThingFromFile

func ThingFromFile(bytes []byte) (*Thing, error)

func ThingFromThing

func ThingFromThing(t *Thing) *Thing

func (*Thing) Draw

func (t *Thing) Draw(s *ebiten.Image)

func (*Thing) ExecuteAction

func (t *Thing) ExecuteAction(a *Action, isGlitching bool)

func (*Thing) GetAction

func (t *Thing) GetAction() *Action

func (*Thing) Girth

func (t *Thing) Girth() (float64, float64)

func (*Thing) HasCollision

func (t *Thing) HasCollision(x, y float64) bool

func (*Thing) IsBlock

func (t *Thing) IsBlock() bool

func (*Thing) IsBlockGlitch

func (t *Thing) IsBlockGlitch() bool

func (*Thing) IsEnemy

func (t *Thing) IsEnemy() bool

func (*Thing) IsExit

func (t *Thing) IsExit() bool

func (*Thing) IsGlitching

func (t *Thing) IsGlitching() bool

func (*Thing) Move

func (t *Thing) Move(move *Move)

func (*Thing) Position

func (t *Thing) Position() (float64, float64)

func (*Thing) Update

func (t *Thing) Update() *Action

type Thingi

type Thingi interface {
	Position() (float64, float64)
	Update() *Action
	Draw(screen *ebiten.Image)
	ExecuteAction(a *Action, isGlitching bool)
	IsGlitching() bool
	IsBlock() bool
	IsBlockGlitch() bool
	IsEnemy() bool
	IsExit() bool
	HasCollision(x, y float64) bool
	Girth() (float64, float64)
}

Jump to

Keyboard shortcuts

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