ecs

package
v0.0.0-...-29d751b Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawCircle

func DrawCircle(r *sdl.Renderer, cx, cy, radius int32)

func FillCircle

func FillCircle(r *sdl.Renderer, cx, cy, radius int32)

FillCircle https://gist.github.com/derofim/912cfc9161269336f722

func Run

func Run() error

Types

type Bounds

type Bounds struct {
	Vector2
	Size
}

type BoxCollider

type BoxCollider struct {
	Offset Vector2
	Size
}

func (*BoxCollider) ToRect

func (a *BoxCollider) ToRect(p *Position) *Rect

type Circle

type Circle struct {
	Vector2
	Radius int
}

func (*Circle) Empty

func (a *Circle) Empty() bool

type CircleCollider

type CircleCollider struct {
	Offset Vector2
	Radius int
}

func (*CircleCollider) ToCircle

func (c *CircleCollider) ToCircle(p *Position) *Circle

type CollectSystem

type CollectSystem struct{}

func (*CollectSystem) GetFilters

func (s *CollectSystem) GetFilters() []gecs.SystemFilter

func (*CollectSystem) Update

func (s *CollectSystem) Update(_ time.Duration, filtered [][]gecs.Entity)

type Collectable

type Collectable struct{}

type CollideEvent

type CollideEvent struct {
	Entities []gecs.Entity
}

type CollideSystem

type CollideSystem struct{}

func (*CollideSystem) GetFilters

func (s *CollideSystem) GetFilters() []gecs.SystemFilter

func (*CollideSystem) Update

func (s *CollideSystem) Update(_ time.Duration, filtered [][]gecs.Entity)

type InputEvent

type InputEvent struct {
	Vector2
}

type InputSystem

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

func (*InputSystem) GetFilters

func (s *InputSystem) GetFilters() []gecs.SystemFilter

func (*InputSystem) Update

func (s *InputSystem) Update(_ time.Duration, filtered [][]gecs.Entity)

type MoveSystem

type MoveSystem struct {
	Velocity int
	Bounds   Bounds
}

func (*MoveSystem) GetFilters

func (s *MoveSystem) GetFilters() []gecs.SystemFilter

func (*MoveSystem) Update

func (s *MoveSystem) Update(delta time.Duration, filtered [][]gecs.Entity)

type Player

type Player struct{}

type Position

type Position struct {
	Vector2
}

type Rect

type Rect = Bounds

func (*Rect) Empty

func (a *Rect) Empty() bool

func (*Rect) HasIntersection

func (a *Rect) HasIntersection(b *Rect) bool

type RenderBox

type RenderBox struct {
	Size
	color.RGBA
}

type RenderCircle

type RenderCircle struct {
	Radius int
	color.RGBA
}

type RenderSystem

type RenderSystem struct {
	Title string
	Size
	// contains filtered or unexported fields
}

func (*RenderSystem) Destroy

func (s *RenderSystem) Destroy()

func (*RenderSystem) GetFilters

func (s *RenderSystem) GetFilters() []gecs.SystemFilter

func (*RenderSystem) Init

func (s *RenderSystem) Init() error

func (*RenderSystem) Update

func (s *RenderSystem) Update(delta time.Duration, filtered [][]gecs.Entity)

type Size

type Size struct {
	Width, Height int
}

type Vector2

type Vector2 struct {
	X, Y int
}

Jump to

Keyboard shortcuts

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