component

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreepSnowblower = iota + 1
	CreepSmallRock
	CreepMediumRock
	CreepLargeRock
)

Variables

View Source
var CreepBulletComponentID = ECS.NewComponentID()
View Source
var CreepComponentID = ECS.NewComponentID()
View Source
var PlayerBulletComponentID = ECS.NewComponentID()
View Source
var PositionComponentID = ECS.NewComponentID()
View Source
var RailComponentID = ECS.NewComponentID()
View Source
var SpriteComponentID = ECS.NewComponentID()
View Source
var VelocityComponentID = ECS.NewComponentID()
View Source
var WeaponComponentID = ECS.NewComponentID()

Functions

This section is empty.

Types

type CreepBulletComponent

type CreepBulletComponent struct {
	Invulnerable bool // Invulnerable to hazards
}

func CreepBullet

func CreepBullet(ctx *gohan.Context) *CreepBulletComponent

func (*CreepBulletComponent) ComponentID

func (p *CreepBulletComponent) ComponentID() gohan.ComponentID

type CreepComponent

type CreepComponent struct {
	Type   int
	Active bool

	Health     int
	FireAmount int
	FireRate   int // In ticks
	FireTicks  int //Ticks until next action

	Movement      int
	Movements     [][3]float64 // X, Y, pre-delay in ticks
	MovementTicks int          // Ticks until next action

	DamageTicks int

	Rand *rand.Rand
}

func Creep

func Creep(ctx *gohan.Context) *CreepComponent

func (*CreepComponent) ComponentID

func (p *CreepComponent) ComponentID() gohan.ComponentID

type PlayerBulletComponent

type PlayerBulletComponent struct {
}

func PlayerBullet

func PlayerBullet(ctx *gohan.Context) *PlayerBulletComponent

func (*PlayerBulletComponent) ComponentID

func (p *PlayerBulletComponent) ComponentID() gohan.ComponentID

type PositionComponent

type PositionComponent struct {
	X, Y float64
}

func Position

func Position(ctx *gohan.Context) *PositionComponent

func (*PositionComponent) ComponentID

func (p *PositionComponent) ComponentID() gohan.ComponentID

type RailComponent

type RailComponent struct {
}

func Rail

func Rail(ctx *gohan.Context) *RailComponent

func (*RailComponent) ComponentID

func (p *RailComponent) ComponentID() gohan.ComponentID

type SpriteComponent

type SpriteComponent struct {
	Image          *ebiten.Image
	HorizontalFlip bool
	VerticalFlip   bool
	DiagonalFlip   bool // TODO unimplemented

	Angle float64

	Overlay            *ebiten.Image
	OverlayX, OverlayY float64 // Overlay offset

	Frame     int
	Frames    []*ebiten.Image
	FrameTime time.Duration
	LastFrame time.Time
	NumFrames int

	DamageTicks int

	OverrideColorScale bool
	ColorScale         float64
}

func Sprite

func Sprite(ctx *gohan.Context) *SpriteComponent

func (*SpriteComponent) ComponentID

func (p *SpriteComponent) ComponentID() gohan.ComponentID

type VelocityComponent

type VelocityComponent struct {
	X, Y float64
}

func Velocity

func Velocity(ctx *gohan.Context) *VelocityComponent

func (*VelocityComponent) ComponentID

func (c *VelocityComponent) ComponentID() gohan.ComponentID

type WeaponComponent

type WeaponComponent struct {
	Equipped bool

	Damage int

	// In ticks
	FireRate int
	NextFire int

	BulletSpeed float64
}

func Weapon

func Weapon(ctx *gohan.Context) *WeaponComponent

func (*WeaponComponent) ComponentID

func (p *WeaponComponent) ComponentID() gohan.ComponentID

Jump to

Keyboard shortcuts

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