components

package
v0.0.0-...-1ebc2e8 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const AIType = "AI"
View Source
const AimingType = "AIAiming"
View Source
const AmbientLightType = "ambientLight"
View Source
const AnimationType = "sprite"
View Source
const BoundingBoxType = "BoundingBox"
View Source
const CameraType = "Camera"
View Source
const CleanupType = "Cleanup"
View Source
const CollisionType = "Collision"
View Source
const DamageType = "Damage"
View Source
const DebugType = "Debug"
View Source
const GoalType = "Goal"
View Source
const HealthType = "Health"
View Source
const LightType = "light"
View Source
const MapType = "Map"
View Source
const MotionControlType = "MotionControl"
View Source
const MotionType = "Motion"
View Source
const ParticleEmitterType = "particleEmitter"
View Source
const PerformanceType = "Performance"
View Source
const ShakingType = "Shaking"
View Source
const ShootingType = "Shooting"
View Source
const SpriteAnimationType = "spriteAnimation"
View Source
const SpriteType = "sprite"
View Source
const TargetType = "Target"
View Source
const TextType = "text"
View Source
const TransformType = "transform"
View Source
const TriggerType = "Trigger"
View Source
const VelocityType = "velocity"

Variables

This section is empty.

Functions

This section is empty.

Types

type AI

type AI struct{}

func (AI) Type

func (t AI) Type() ecs.ComponentType

type Aiming

type Aiming struct {
	TargetGroup int
}

func (Aiming) Load

func (Aiming) Load(data []byte) game.LoadableComponent

func (Aiming) Type

func (Aiming) Type() ecs.ComponentType

type AmbientLight

type AmbientLight struct {
	CompositeMode ebiten.CompositeMode
	Color         lib.Color
	Active        bool
}

func (AmbientLight) Type

func (s AmbientLight) Type() ecs.ComponentType

type Animation

type Animation struct {
	CurrentSprite *ebiten.Image
	ZIndex        int

	Steps       []AnimationStep
	Repeat      bool
	CurrentTime time.Time
}

func (Animation) Type

func (s Animation) Type() ecs.ComponentType

type AnimationStep

type AnimationStep struct {
	Image    *ebiten.Image
	Duration time.Duration
}

type BoundingBox

type BoundingBox struct {
	Width  float64
	Height float64
}

BoundingBox, component for collision detection

func (BoundingBox) Type

func (t BoundingBox) Type() ecs.ComponentType

type Camera

type Camera struct {
	CameraMode camera.CameraMode
	Zoom       float64
}

Camera is a component to control the camera

func (Camera) Type

func (t Camera) Type() ecs.ComponentType

type Cleanup

type Cleanup struct {
}

Cleanup, empty component filtering

func (Cleanup) Type

func (t Cleanup) Type() ecs.ComponentType

type Collision

type Collision struct {
	Target *ecs.Entity
}

Collision, omponent for filtering collision

func (Collision) Type

func (t Collision) Type() ecs.ComponentType

type Damage

type Damage struct {
	Value int
}

func (Damage) Type

func (t Damage) Type() ecs.ComponentType

type Debug

type Debug struct{}

func (Debug) Type

func (Debug) Type() ecs.ComponentType

type Goal

type Goal struct{}

func (Goal) Type

func (t Goal) Type() ecs.ComponentType

type Health

type Health struct {
	Value int
}

func (Health) Type

func (t Health) Type() ecs.ComponentType

type Light

type Light struct {
	Image *ebiten.Image // #47 - how to load assets
	Color lib.Color
}

func (Light) Type

func (s Light) Type() ecs.ComponentType

type Map

type Map struct {
}

func (Map) Type

func (t Map) Type() ecs.ComponentType

type Motion

type Motion struct {
	Velocity        vector.Vec2d
	AngularVelocity float64
}

Motion stores the current velocity as well as angular velocity

func (Motion) Type

func (s Motion) Type() ecs.ComponentType

type MotionControl

type MotionControl struct {
	KeyForward  ebiten.Key
	KeyBackward ebiten.Key
	KeyRight    ebiten.Key
	KeyLeft     ebiten.Key

	AccelerationRate float64
	RotationRate     float64
}

MotionControl contains the keymapping and other settings related to motion

func NewMotionControl

func NewMotionControl() *MotionControl

func (*MotionControl) Accelerate

func (t *MotionControl) Accelerate()

func (MotionControl) Type

func (t MotionControl) Type() ecs.ComponentType

type ParticleEmitter

type ParticleEmitter struct {
	Color        color.Color
	Position_min float64
	Position_max float64
	Velocity_min float64
	Velocity_max float64
	Lifetime_min int
	Lifetime_max int

	Spawn_interval time.Duration
	Last_emitted   time.Time

	Velocity      float64
	Direction_min int
	Direction_max int
}

Text holds all information needed to render text

func (ParticleEmitter) Type

type Performance

type Performance struct {
	ShowFPS         bool
	ShowTPS         bool
	ShowEntityCount bool

	ShowGraph     bool
	HistoryLength int
	PastFPS       []float64
}

Performance

func (Performance) Type

func (t Performance) Type() ecs.ComponentType

type Shaking

type Shaking struct {
}

Shaking, empty component for filtering shakables

func (Shaking) Type

func (t Shaking) Type() ecs.ComponentType

type Shooting

type Shooting struct {
	CooldownMin int
	CooldownMax int
	Cooldown    int

	Active bool
}

func (Shooting) Type

func (t Shooting) Type() ecs.ComponentType

type Sprite

type Sprite struct {
	Image     *ebiten.Image `json:"-"`
	ImageName string
	ZIndex    int
}

func (Sprite) Type

func (s Sprite) Type() ecs.ComponentType

type SpriteAnimation

type SpriteAnimation struct {
	Idx        int
	Duration   time.Duration
	Images     []*ebiten.Image
	LastUpdate time.Time
}

func (SpriteAnimation) Type

type Target

type Target struct {
	GroupId int
}

func (Target) Type

func (Target) Type() ecs.ComponentType

type Text

type Text struct {
	Value string
	Color lib.Color
	Font  font.Face
}

Text holds all information needed to render text

func (Text) Type

func (t Text) Type() ecs.ComponentType

type Transform

type Transform struct {
	Point vector.Vec2d

	Scale    float64
	Rotation float64

	Parent  *Transform
	OffsetX float64
	OffsetY float64

	Children []*Transform
}

Transform holds all information needed to position the entity in the world

func (*Transform) AddParent

func (t *Transform) AddParent(p *Transform)

func (Transform) Type

func (t Transform) Type() ecs.ComponentType

type Trigger

type Trigger struct {
	Action func(e *ecs.Entity, em *ecs.EntityManager)
}

Trigger, empty component filtering

func (Trigger) Type

func (t Trigger) Type() ecs.ComponentType

type Velocity deprecated

type Velocity struct {
	X float64
	Y float64

	Rotation float64

	IntertiaMax float64
	Intertia    float64
}

Deprecated: please use the Motion component instead.

func (*Velocity) IncreaseInertia

func (v *Velocity) IncreaseInertia()

func (*Velocity) ResetInertia

func (v *Velocity) ResetInertia()

func (Velocity) Type

func (Velocity) Type() ecs.ComponentType

Jump to

Keyboard shortcuts

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