components

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaskPosition = uint64(1 << 0)
	MaskSize     = uint64(1 << 1)
	MaskState    = uint64(1 << 2)
	MaskTexture  = uint64(1 << 3)
	MaskVelocity = uint64(1 << 4)
)
View Source
const (
	StateControlsNo = uint64(0)
	StateControlsW  = uint64(1 << 0)
	StateControlsA  = uint64(1 << 1)
	StateControlsS  = uint64(1 << 2)
	StateControlsD  = uint64(1 << 3)
)
View Source
const (
	StatePlayerIdle = uint64(0)
	StatePlayerMove = uint64(1 << 0)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Position

type Position struct {
	X float32 `json:"x"`
	Y float32 `json:"y"`
}

func NewPosition

func NewPosition() *Position

func (*Position) Mask

func (a *Position) Mask() uint64

func (*Position) WithX

func (a *Position) WithX(x float32) *Position

func (*Position) WithY

func (a *Position) WithY(y float32) *Position

type Size

type Size struct {
	Width  float32 `json:"width"`
	Height float32 `json:"height"`
}

func NewSize

func NewSize() *Size

func (*Size) Mask

func (a *Size) Mask() uint64

func (*Size) WithHeight

func (a *Size) WithHeight(height float32) *Size

func (*Size) WithWidth

func (a *Size) WithWidth(width float32) *Size

type State added in v0.1.7

type State struct {
	Duration time.Duration `json:"duration"`
	Next     uint64        `json:"next"`
	Start    time.Time     `json:"start"`
	Value    uint64        `json:"value"`
}

func NewState added in v0.1.7

func NewState() *State

func (*State) HasState added in v0.1.9

func (a *State) HasState(state uint64) bool

func (*State) Mask added in v0.1.7

func (a *State) Mask() uint64

func (*State) Remove added in v0.1.9

func (a *State) Remove(state uint64, duration time.Duration)

func (*State) Set added in v0.1.9

func (a *State) Set(state uint64, duration time.Duration)

func (*State) Tick added in v0.1.10

func (a *State) Tick()

type Texture

type Texture struct {
	Path    string `json:"path"`
	Visible bool   `json:"visible"`
	Tex     *rl.Texture2D
}

func NewTexture

func NewTexture() *Texture

func (*Texture) Mask

func (a *Texture) Mask() uint64

func (*Texture) WithPath

func (a *Texture) WithPath(path string) *Texture

func (*Texture) WithVisible

func (a *Texture) WithVisible(visible bool) *Texture

type Velocity

type Velocity struct {
	X float32 `json:"x"`
	Y float32 `json:"y"`
}

func NewVelocity

func NewVelocity() *Velocity

func (*Velocity) Mask

func (a *Velocity) Mask() uint64

func (*Velocity) WithX

func (a *Velocity) WithX(x float32) *Velocity

func (*Velocity) WithY

func (a *Velocity) WithY(y float32) *Velocity

Jump to

Keyboard shortcuts

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