world

package
v0.0.0-...-d37d129 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CameraComponent

type CameraComponent struct {
	OffsetX, OffsetY float64
}

type Entity

type Entity struct {
	Name string
	Tags map[string]struct{}

	Level    Level
	Position Position
	Static   bool

	HatVelocityComponent bool
	VelocityComponent    VelocityComponent

	HatHitboxComponent bool
	HitboxComponent    HitboxComponent

	HatRendererHitboxComponent bool
	RendererHitboxComponent    RendererHitboxComponent

	HatRigidbodyComponent bool
	RigidbodyComponent    RigidbodyComponent

	HatKeyboardMovementComponent bool
	KeyboardMovementComponent    KeyboardMovementComponent

	HatTouchInputComponent bool
	TouchInputComponent    TouchInputComponent

	HatInteraktionComponent bool
	InteraktionComponent    InteraktionComponent

	HatMoveToPositionComponent bool
	MoveToPositionComponent    MoveToPositionComponent

	HatMoveToPositionsComponent bool
	MoveToPositionsComponent    MoveToPositionsComponent

	HatPathfinderComponent bool
	PathfinderComponent    PathfinderComponent

	HatPortalComponent bool
	PortalComponent    PortalComponent

	HatCameraComponent bool
	CameraComponent    CameraComponent

	HatRenderComponent bool
	RenderComponent    RenderComponent

	HatRectRenderComponent bool
	RectRenderComponent    RectRenderComponent

	HatKreisRenderComponent bool
	KreisRenderComponent    KreisRenderComponent

	HatImageRenderComponent bool
	ImageRenderComponent    ImageRenderComponent
}

func (*Entity) HasTag

func (e *Entity) HasTag(tag string) bool

type HitboxComponent

type HitboxComponent struct {
	Width, Height    float64
	OffsetX, OffsetY float64
}

type ImageRenderComponent

type ImageRenderComponent struct {
	Image    *ebiten.Image
	Rotation float64
	Scale    float64
}

type InteraktionComponent

type InteraktionComponent struct {
	OffsetX, OffsetY float64
	Width, Height    float64
	Callback         func()
}

type KeyboardMovementComponent

type KeyboardMovementComponent struct {
	Unten, Oben, Links, Rechts ebiten.Key
	Speed                      float64
}

type KreisRenderComponent

type KreisRenderComponent struct {
	Size  float64
	Farbe color.Color
}

type Level

type Level int

type MoveToPositionComponent

type MoveToPositionComponent struct {
	Position Position
	Speed    float64
	Arrived  bool
}

type MoveToPositionsComponent

type MoveToPositionsComponent struct {
	Positions       []Position
	Speed           float64
	CurrentPosition int
	Finished        bool
}

type PathfinderComponent

type PathfinderComponent struct {
	DestinationPosition Position
	DestinationLevel    Level
	Speed               float64
	State               PathfinderComponentState
}

type PathfinderComponentState

type PathfinderComponentState byte
const (
	PathfinderComponentStateNotStarted PathfinderComponentState = iota
	PathfinderComponentStateMovingToPortal
	PathfinderComponentStateMovingToDestination
	PathfinderComponentStateNoPath
	PathfinderComponentStateArrived
)

type PortalComponent

type PortalComponent struct {
	Width, Height       float64
	DestinationLevel    Level
	DestinationPosition Position
}

type Position

type Position struct {
	X, Y float64
}

type RectRenderComponent

type RectRenderComponent struct {
	Width, Height float64
	Farbe         color.Color
}

type RenderComponent

type RenderComponent struct {
	Layer RenderLayer
}

type RenderLayer

type RenderLayer int

type RendererHitboxComponent

type RendererHitboxComponent struct{}

type RigidbodyComponent

type RigidbodyComponent struct{}

type TouchInputComponent

type TouchInputComponent struct {
	Speed        float64
	Sensitivität float64
}

type VelocityComponent

type VelocityComponent struct {
	VelocityX float64
	VelocityY float64
}

type World

type World struct {
	Entities map[*Entity]struct{}

	Backgrounds map[Level]color.Color
	LevelNames  map[Level]string
	// contains filtered or unexported fields
}

func NewEmptyWorld

func NewEmptyWorld() *World

func (*World) Draw

func (w *World) Draw(screen *ebiten.Image)

func (*World) FindEntitiesWithTag

func (w *World) FindEntitiesWithTag(tag string) []*Entity

func (*World) FindEntityWithName

func (w *World) FindEntityWithName(name string) *Entity

func (*World) SpawnEntity

func (w *World) SpawnEntity(entity *Entity) *Entity

func (*World) Update

func (w *World) Update()

Jump to

Keyboard shortcuts

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