Versions in this module Expand all Collapse all v1 v1.0.2 Jun 30, 2022 v1.0.1 Jun 29, 2022 v1.0.0 Jun 29, 2022 Changes in this version + const ToolDestroy + const ToolGun + const ToolNone + const ToolTurret + const ToolWall + var ScreenHeight int = 360 + var ScreenWidth int = 640 + func DrawTurret(screen *ebiten.Image, screenOp *ebiten.DrawImageOptions, ...) + func DrawWaves(w *World, screen *ebiten.Image, spawnerOp *ebiten.DrawImageOptions) + func GetDirection(sx, sy, tx, ty float64) (float64, float64) + func GetDistanceVector(sx, sy, tx, ty float64) (float64, float64) + func GetMagnitude(x, y float64) float64 + func GetToolImage(t ToolKind, k string) *ebiten.Image + func IsWithinRadius(sx, sy, tx, ty, radius float64) bool + func Normalize(vX, vY, magnitude float64) (float64, float64) + func ObjectsNearest(l []K, x, y float64) []K + func ObjectsWithPolarity(l []K, p data.Polarity) []K + func ObjectsWithinRadius(l []K, x, y, radius float64) []K + type ActorEntity struct + func NewActorEntity(player *Player, config data.EntityConfig) *ActorEntity + func (e *ActorEntity) Draw(screen *ebiten.Image, screenOp *ebiten.DrawImageOptions) + func (e *ActorEntity) Update(world *World) (request Request, err error) + type Animation struct + func NewAnimation(images []*ebiten.Image, frameTime, speed float64) *Animation + func (a *Animation) Draw(screen *ebiten.Image, op *ebiten.DrawImageOptions) + func (a *Animation) Image() *ebiten.Image + func (a *Animation) Iterate() + func (a *Animation) Update() + type BaseEntity struct + func (e *BaseEntity) Action() EntityAction + func (e *BaseEntity) Animation() *Animation + func (e *BaseEntity) CanPathfind() bool + func (e *BaseEntity) IsCollided(t Entity) bool + func (e *BaseEntity) IsProjectile() bool + func (e *BaseEntity) IsWithinMagneticField(t Entity) bool + func (e *BaseEntity) NetID() int + func (e *BaseEntity) Physics() *PhysicsObject + func (e *BaseEntity) SetAction(a EntityAction) + func (e *BaseEntity) SetNetID(nid int) + func (e *BaseEntity) SetSteps(s []pathing.Step) + func (e *BaseEntity) Trash() + func (e *BaseEntity) Trashed() bool + func (e *BaseEntity) Turret() *Turret + type BuildMode struct + func (m *BuildMode) Draw(w *World, screen *ebiten.Image) + func (m *BuildMode) Init(w *World) error + func (m *BuildMode) Local() bool + func (m *BuildMode) Update(w *World) (next WorldMode, err error) + func (m BuildMode) String() string + func (m BuildMode) Type() net.TypedMessageType + type CollectOrbRequest struct + Collector string + Worth int + func (r CollectOrbRequest) Type() net.TypedMessageType + type CoreEntity struct + func NewCoreEntity(config data.EntityConfig) *CoreEntity + func (e *CoreEntity) Draw(screen *ebiten.Image, screenOp *ebiten.DrawImageOptions) + func (e *CoreEntity) Update(world *World) (request Request, err error) + type DamageCoreRequest struct + Damage int + ID int + func (r DamageCoreRequest) Type() net.TypedMessageType + type DummyRequest struct + func (r DummyRequest) Type() net.TypedMessageType + type EnemyEntity struct + func NewEnemyEntity(config data.EntityConfig) *EnemyEntity + func (e *EnemyEntity) CanPathfind() bool + func (e *EnemyEntity) Draw(screen *ebiten.Image, screenOp *ebiten.DrawImageOptions) + func (e *EnemyEntity) SetSteps(s []pathing.Step) + func (e *EnemyEntity) Update(world *World) (request Request, err error) + type Entity interface + Action func() EntityAction + Animation func() *Animation + CanPathfind func() bool + Draw func(screen *ebiten.Image, op *ebiten.DrawImageOptions) + IsCollided func(t Entity) bool + IsProjectile func() bool + IsWithinMagneticField func(t Entity) bool + NetID func() int + Physics func() *PhysicsObject + SetAction func(a EntityAction) + SetNetID func(nid int) + SetSteps func(p []pathing.Step) + Trash func() + Trashed func() bool + Turret func() *Turret + Update func(world *World) (Request, error) + type EntityAction interface + Complete func() bool + GetNext func() EntityAction + Replaceable func() bool + Type func() net.TypedMessageType + type EntityActionMove struct + Distance float64 + Next EntityAction + X float64 + Y float64 + func (a *EntityActionMove) Complete() bool + func (a *EntityActionMove) GetNext() EntityAction + func (a *EntityActionMove) Replaceable() bool + func (a EntityActionMove) Type() net.TypedMessageType + type EntityActionPlace struct + Kind string + Polarity data.Polarity + Tool ToolKind + X int + Y int + func (a *EntityActionPlace) Complete() bool + func (a *EntityActionPlace) GetNext() EntityAction + func (a *EntityActionPlace) Replaceable() bool + func (a EntityActionPlace) Type() net.TypedMessageType + type EntityActionShoot struct + Next EntityAction + Polarity data.Polarity + TargetX float64 + TargetY float64 + func (a *EntityActionShoot) Complete() bool + func (a *EntityActionShoot) GetNext() EntityAction + func (a *EntityActionShoot) Replaceable() bool + func (a EntityActionShoot) Type() net.TypedMessageType + type EntityPropertySync struct + Health int + NetID int + X float64 + Y float64 + func (r EntityPropertySync) Type() net.TypedMessageType + type Game interface + GetOptions func() *data.Options + GetPlayerByName func(p string) *Player + Net func() *net.Connection + Players func() []*Player + type LiveCell struct + func (c *LiveCell) IsOpen() bool + type LossMode struct + func (m *LossMode) Draw(w *World, screen *ebiten.Image) + func (m *LossMode) Init(w *World) error + func (m *LossMode) Local() bool + func (m *LossMode) Update(w *World) (next WorldMode, err error) + func (m LossMode) String() string + func (m LossMode) Type() net.TypedMessageType + type MultiRequest struct + Requests []Request + func (r MultiRequest) Type() net.TypedMessageType + type OrbEntity struct + func NewOrbEntity(worth int) *OrbEntity + func (e *OrbEntity) Draw(screen *ebiten.Image, screenOp *ebiten.DrawImageOptions) + func (e *OrbEntity) Update(world *World) (request Request, err error) + type PhysicsObject struct + OffsetX float64 + OffsetY float64 + X float64 + Y float64 + func SplitVectorByDegree(spreadArc, vX, vY float64, num int) (vectors []PhysicsObject) + func (p *PhysicsObject) GetMagneticAffect(polarity data.Polarity, magnitude float64) float64 + func (p *PhysicsObject) GetMagneticVector(t PhysicsObject) (float64, float64) + type PlaySoundRequest struct + Sound string + func (r PlaySoundRequest) Type() net.TypedMessageType + type Player struct + Entity Entity + HoverColumn int + HoverRow int + HoveringPlace EntityActionPlace + HoveringPlacement bool + Local bool + Name string + Points int + ReadyForWave bool + Toolbelt Toolbelt + func NewPlayer() *Player + func (p *Player) Update(w *World) (EntityAction, error) + type PointsSync struct + Points map[string]int + func (r PointsSync) Type() net.TypedMessageType + type PostGameMode struct + func (m *PostGameMode) Draw(w *World, screen *ebiten.Image) + func (m *PostGameMode) Init(w *World) error + func (m *PostGameMode) Local() bool + func (m *PostGameMode) Update(w *World) (next WorldMode, err error) + func (m PostGameMode) String() string + func (m PostGameMode) Type() net.TypedMessageType + type PreGameMode struct + func (m *PreGameMode) Draw(w *World, screen *ebiten.Image) + func (m *PreGameMode) Init(w *World) error + func (m *PreGameMode) Local() bool + func (m *PreGameMode) Update(w *World) (next WorldMode, err error) + func (m PreGameMode) String() string + func (m PreGameMode) Type() net.TypedMessageType + type ProgressBar struct + func NewProgressBar(width, height int, barColor color.RGBA) *ProgressBar + func (pb *ProgressBar) Draw(screen *ebiten.Image, screenOp *ebiten.DrawImageOptions) + func (pb *ProgressBar) Update() + type ProjecticleEntity struct + func NewProjecticleEntity() *ProjecticleEntity + func (e *ProjecticleEntity) Draw(screen *ebiten.Image, screenOp *ebiten.DrawImageOptions) + func (e *ProjecticleEntity) IsProjectile() bool + func (e *ProjecticleEntity) Update(world *World) (request Request, err error) + type Request interface + Type func() net.TypedMessageType + type SelectToolbeltItemRequest struct + func (r SelectToolbeltItemRequest) Type() net.TypedMessageType + type SpawnEnemyRequest struct + Kind string + NetID int + Polarity data.Polarity + X float64 + Y float64 + func (r SpawnEnemyRequest) Type() net.TypedMessageType + type SpawnOrbRequest struct + NetID int + Worth int + X float64 + Y float64 + func (r SpawnOrbRequest) Type() net.TypedMessageType + type SpawnProjecticleRequest struct + Damage int + NetID int + Polarity data.Polarity + VX float64 + VY float64 + X float64 + Y float64 + func (r SpawnProjecticleRequest) Type() net.TypedMessageType + type SpawnToolEntityRequest struct + Kind string + NetID int + Polarity data.Polarity + Tool ToolKind + X int + Y int + func (r SpawnToolEntityRequest) Type() net.TypedMessageType + type SpawnerEntity struct + func NewSpawnerEntity(p data.Polarity) *SpawnerEntity + func (e *SpawnerEntity) CanPathfind() bool + func (e *SpawnerEntity) Draw(screen *ebiten.Image, screenOp *ebiten.DrawImageOptions) + func (e *SpawnerEntity) SetSteps(s []pathing.Step) + func (e *SpawnerEntity) Update(world *World) (request Request, err error) + type StartModeRequest struct + func (r StartModeRequest) Type() net.TypedMessageType + type ToolKind string + type Toolbelt struct + func (t *Toolbelt) ActivateItem(item *ToolbeltItem) + func (t *Toolbelt) CheckHit(x, y int) bool + func (t *Toolbelt) Draw(screen *ebiten.Image) + func (t *Toolbelt) Position() + func (t *Toolbelt) ScrollItem(dir int) + func (t *Toolbelt) Update() (request Request) + type ToolbeltItem struct + func (t *ToolbeltItem) Cycle() + func (t *ToolbeltItem) Draw(screen *ebiten.Image) + func (t *ToolbeltItem) DrawSlot(screen *ebiten.Image) + func (t *ToolbeltItem) Position(sx, sy *int) + func (t *ToolbeltItem) Update() (request Request) + type TouchContainer struct + type TrashEntityRequest struct + NetID int + func (r TrashEntityRequest) Type() net.TypedMessageType + type Turret struct + func (t *Turret) CanFire(speed float64) bool + func (t *Turret) Tick(speed float64) + type TurretBeamEntity struct + func NewTurretBeamEntity(config data.EntityConfig) *TurretBeamEntity + func (e *TurretBeamEntity) AcquireTarget(world *World) + func (e *TurretBeamEntity) Draw(screen *ebiten.Image, screenOp *ebiten.DrawImageOptions) + func (e *TurretBeamEntity) Update(world *World) (request Request, err error) + type TurretEntity struct + func NewTurretEntity(config data.EntityConfig) *TurretEntity + func (e *TurretEntity) AcquireTarget(world *World) + func (e *TurretEntity) Draw(screen *ebiten.Image, screenOp *ebiten.DrawImageOptions) + func (e *TurretEntity) Update(world *World) (request Request, err error) + type UseToolRequest struct + Kind string + NetID int + Owner string + Polarity data.Polarity + Tool ToolKind + X int + Y int + func (r UseToolRequest) Type() net.TypedMessageType + type VictoryMode struct + func (m *VictoryMode) Draw(w *World, screen *ebiten.Image) + func (m *VictoryMode) Init(w *World) error + func (m *VictoryMode) Local() bool + func (m *VictoryMode) Update(w *World) (next WorldMode, err error) + func (m VictoryMode) String() string + func (m VictoryMode) Type() net.TypedMessageType + type WallEntity struct + func NewWallEntity() *WallEntity + func (e *WallEntity) Draw(screen *ebiten.Image, screenOp *ebiten.DrawImageOptions) + func (e *WallEntity) Update(world *World) (request Request, err error) + type WaveMode struct + func (m *WaveMode) Draw(w *World, screen *ebiten.Image) + func (m *WaveMode) Init(w *World) error + func (m *WaveMode) Local() bool + func (m *WaveMode) Update(w *World) (next WorldMode, err error) + func (m WaveMode) String() string + func (m WaveMode) Type() net.TypedMessageType + type World struct + CameraX float64 + CameraY float64 + CurrentWave int + Game Game + MaxWave int + Mode WorldMode + Speed float64 + func (w *World) AreCoresDead() bool + func (w *World) AreEnemiesDead() bool + func (w *World) ArePlayersReady() bool + func (w *World) AreSpawnersHolding() bool + func (w *World) AreWavesComplete() bool + func (w *World) BuildFromLevel(level data.Level) error + func (w *World) CollectOrb(r CollectOrbRequest) + func (w *World) DamageCore(r DamageCoreRequest) + func (w *World) Draw(screen *ebiten.Image) + func (w *World) GetCell(x, y int) *LiveCell + func (w *World) GetClosestCellPosition(x, y int) (int, int) + func (w *World) GetCursorPosition() (x, y int) + func (w *World) GetNextNetID() int + func (w *World) HandleToolRequest(r UseToolRequest) Entity + func (w *World) IsPlacementValid(placeX, placeY int) bool + func (w *World) PlaceEntityAt(e Entity, x, y float64) + func (w *World) PlaceEntityInCell(e Entity, x, y int) + func (w *World) ProcessNetMessage(msg net.Message) error + func (w *World) ProcessRequest(r Request) + func (w *World) SendPlayerPoints() + func (w *World) SetMode(m WorldMode) + func (w *World) SetWaves() + func (w *World) SpawnEnemyEntity(r SpawnEnemyRequest) *EnemyEntity + func (w *World) SpawnOrbEntity(r SpawnOrbRequest) *OrbEntity + func (w *World) SpawnProjecticleEntity(r SpawnProjecticleRequest) *ProjecticleEntity + func (w *World) SplitPoints(value int) + func (w *World) SyncEntity(r EntityPropertySync) + func (w *World) SyncPoints(r PointsSync) + func (w *World) Update() error + func (w *World) UpdateEntityPathing(e Entity) + func (w *World) UpdatePathing() + type WorldMode interface + Draw func(w *World, screen *ebiten.Image) + Init func(w *World) error + Local func() bool + String func() string + Type func() net.TypedMessageType + Update func(w *World) (WorldMode, error)