Documentation ¶
Index ¶
- Constants
- Variables
- func CheckActiveCondition(check *[]string, interactives []*Interactive) bool
- func CheckConditions(conditions []*resources.ConditionDef, interactives []*Interactive, ...) bool
- func CheckKilledEnemiesCondition(check *[]string, enemies []*Enemy) bool
- type Action
- type ActionDeflect
- type ActionFindNearestActor
- type ActionMove
- type ActionReverse
- type ActionShield
- type ActionSpawnBullets
- type ActionSpawnEnemy
- type ActionSpawnParticle
- type Actor
- type ActorActions
- type Bullet
- type BulletActions
- type BulletGroup
- type BulletType
- type Cell
- type CellCollision
- type CircleShape
- type Companion
- func (p *Companion) Bounds() (x, y, w, h float64)
- func (p *Companion) Dead() bool
- func (p *Companion) Destroyed() bool
- func (p *Companion) Draw(ctx states.DrawContext)
- func (p *Companion) DrawHand(ctx states.DrawContext)
- func (p *Companion) DrawHat(screen *ebiten.Image, x, y float64)
- func (p *Companion) HasEnergyFor(imp Impulse) bool
- func (p *Companion) Player() Player
- func (p *Companion) Restore()
- func (p *Companion) Save()
- func (p *Companion) SetImpulses(impulses ImpulseSet)
- func (p *Companion) SetPlayer(player Player)
- func (p *Companion) SetSize(r float64)
- func (p *Companion) SetXY(x, y float64)
- func (p *Companion) Shape() Shape
- func (p *Companion) Snarf()
- func (p *Companion) Update() (actions []Action)
- type Enemy
- func (e *Enemy) Bounds() (x, y, w, h float64)
- func (e *Enemy) Damage(amount int) bool
- func (e *Enemy) Dead() bool
- func (e *Enemy) Destroyed() bool
- func (e *Enemy) Draw(ctx states.DrawContext)
- func (e *Enemy) ID() string
- func (e *Enemy) IsAlive() bool
- func (e *Enemy) Player() Player
- func (e *Enemy) Restore()
- func (e *Enemy) Save()
- func (e *Enemy) SetImpulses(impulses ImpulseSet)
- func (e *Enemy) SetPlayer(p Player)
- func (e *Enemy) SetSize(r float64)
- func (e *Enemy) SetTarget(a Actor)
- func (e *Enemy) SetXY(x, y float64)
- func (e *Enemy) Shape() Shape
- func (e *Enemy) Update() (a []Action)
- type EnemyState
- type GroupAngle
- type Hand
- type HintGroup
- type Hints
- type Impulse
- type ImpulseDeflect
- type ImpulseMove
- type ImpulseReverse
- type ImpulseSet
- type ImpulseShield
- type ImpulseShoot
- type Interactive
- func (i *Interactive) Active() bool
- func (i *Interactive) AddLinkedInteractive(interactives *Interactive)
- func (i *Interactive) Bounds() (x, y, w, h float64)
- func (i *Interactive) Conditions() []*resources.ConditionDef
- func (i *Interactive) Dead() bool
- func (i *Interactive) DecreaseActivation(parentIds []string)
- func (i *Interactive) Destroyed() bool
- func (i *Interactive) Draw(ctx states.DrawContext)
- func (i *Interactive) Hit()
- func (i *Interactive) ID() string
- func (i *Interactive) IncreaseActivation(parentIds []string)
- func (i *Interactive) Player() Player
- func (i *Interactive) Restore()
- func (i *Interactive) Reverse()
- func (i *Interactive) Reverseable() bool
- func (i *Interactive) Save()
- func (i *Interactive) SetImpulses(impulses ImpulseSet)
- func (i *Interactive) SetPlayer(p Player)
- func (i *Interactive) SetSize(r float64)
- func (i *Interactive) SetXY(x, y float64)
- func (i *Interactive) Shape() Shape
- func (i *Interactive) Shootable() bool
- func (i *Interactive) Touchable() bool
- func (i *Interactive) Update() []Action
- type LocalPlayer
- func (p *LocalPlayer) Actor() Actor
- func (p *LocalPlayer) ClearImpulses()
- func (p *LocalPlayer) Hat() string
- func (p *LocalPlayer) Impulses() ImpulseSet
- func (p *LocalPlayer) QueueImpulses(impulses ImpulseSet)
- func (p *LocalPlayer) Ready(nextTick int) bool
- func (p *LocalPlayer) SetActor(actor Actor)
- func (p *LocalPlayer) SetHat(hat string)
- func (p *LocalPlayer) Thoughts() Thoughts
- func (p *LocalPlayer) Tick()
- func (p *LocalPlayer) Update()
- type Map
- type Overlay
- type PC
- func (p *PC) Bounds() (x, y, w, h float64)
- func (p *PC) Dead() bool
- func (p *PC) Destroyed() bool
- func (p *PC) Draw(ctx states.DrawContext)
- func (p *PC) DrawHand(ctx states.DrawContext)
- func (p *PC) DrawHat(screen *ebiten.Image, x, y float64)
- func (p *PC) HasEnergyFor(imp Impulse) bool
- func (p *PC) Hurtie()
- func (p *PC) PlayAudio(deflecting, reversing, shielding bool)
- func (p *PC) Player() Player
- func (p *PC) Restore()
- func (p *PC) Save()
- func (p *PC) SetImpulses(impulses ImpulseSet)
- func (p *PC) SetPlayer(player Player)
- func (p *PC) SetSize(r float64)
- func (p *PC) SetXY(x, y float64)
- func (p *PC) Shape() Shape
- func (p *PC) Update() (actions []Action)
- type Particle
- type Player
- type QuitThought
- type RectangleShape
- type RemotePlayer
- func (p *RemotePlayer) Actor() Actor
- func (p *RemotePlayer) ClearImpulses()
- func (p *RemotePlayer) Hat() string
- func (p *RemotePlayer) Impulses() ImpulseSet
- func (p *RemotePlayer) Peer() *net.Peer
- func (p *RemotePlayer) QueueImpulses(impulses ImpulseSet)
- func (p *RemotePlayer) Ready(nextTick int) bool
- func (p *RemotePlayer) SetActor(actor Actor)
- func (p *RemotePlayer) SetHat(hat string)
- func (p *RemotePlayer) Thoughts() Thoughts
- func (p *RemotePlayer) Tick()
- func (p *RemotePlayer) Update()
- type ResetThought
- type Shape
- type Snaggable
- func (s *Snaggable) Bounds() (x, y, w, h float64)
- func (s *Snaggable) Dead() bool
- func (s *Snaggable) Destroyed() bool
- func (s *Snaggable) Draw(ctx states.DrawContext)
- func (s *Snaggable) Player() Player
- func (s *Snaggable) Restore()
- func (s *Snaggable) Save()
- func (s *Snaggable) SetImpulses(impulses ImpulseSet)
- func (s *Snaggable) SetPlayer(p Player)
- func (s *Snaggable) SetSize(r float64)
- func (s *Snaggable) SetXY(x, y float64)
- func (s *Snaggable) Shape() Shape
- func (s *Snaggable) Update() (actions []Action)
- type Spawner
- func (s *Spawner) Bounds() (x, y, w, h float64)
- func (s *Spawner) Dead() bool
- func (s *Spawner) Destroyed() bool
- func (s *Spawner) Draw(states.DrawContext)
- func (s *Spawner) Player() Player
- func (s *Spawner) Restore()
- func (s *Spawner) Save()
- func (s *Spawner) SetImpulses(impulses ImpulseSet)
- func (s *Spawner) SetPlayer(p Player)
- func (s *Spawner) SetSize(r float64)
- func (s *Spawner) SetXY(x, y float64)
- func (s *Spawner) Shape() Shape
- func (s *Spawner) Update() (actions []Action)
- type Thought
- type Thoughts
- type TickState
- type World
- func (s *World) ArePlayersDead() bool
- func (s *World) CurrentState() WorldState
- func (s *World) DoPlayersShareThought(thought Thought) bool
- func (s *World) Draw(ctx states.DrawContext)
- func (s *World) Enter(ctx states.Context, v interface{}) error
- func (s *World) Finalize(ctx states.Context) error
- func (s *World) FindNearestActor(from Shape, a Actor) Actor
- func (s *World) HandleTrash()
- func (s *World) Init(ctx states.Context) error
- func (s *World) IntersectingActors(sh Shape) []Actor
- func (s *World) IntersectingBullets(sh Shape) []*Bullet
- func (s *World) NewCompanion(ctx states.Context) *Companion
- func (s *World) NewPC(ctx states.Context) *PC
- func (s *World) PlayerFromPeer(peer *net.Peer) *RemotePlayer
- func (s *World) PopState(ctx states.Context)
- func (s *World) PushState(state WorldState, ctx states.Context)
- func (s *World) ResetActiveMap(ctx states.Context) error
- func (w *World) SpawnParticle(ctx states.Context, img string, x, y float64, angle float64, speed float64, ...)
- func (s *World) TravelToMap(ctx states.Context, mapName string) error
- func (s *World) Update(ctx states.Context) error
- type WorldState
- type WorldStateBegin
- type WorldStateDead
- type WorldStateEnd
- type WorldStateLive
Constants ¶
const ( Circular BulletType = "circular" // Default (●) Directional = "directional" // Bi-directional <●> Vector = "vector" // Vector ●> )
Defines the different types of rendered bullets
const ( Fixed = "fixed" // Fixed angle Radial = "radial" // Radial angle from spawner Random = "random" // Random angle )
const ACTIVATE_COOLDOWN = 5
Default cooldown for interactive activation + degradation
const DEGRADE_COOLDOWN = ACTIVATE_COOLDOWN * 10
Variables ¶
var ( ErrMissingMap = errors.New("missing map") ErrNoActiveMap = errors.New("no active map") )
Functions ¶
func CheckActiveCondition ¶
func CheckActiveCondition(check *[]string, interactives []*Interactive) bool
Check that all interactives in args are active
func CheckConditions ¶
func CheckConditions(conditions []*resources.ConditionDef, interactives []*Interactive, enemies []*Enemy) bool
Check all provided conditions are true If no conditions, return false
func CheckKilledEnemiesCondition ¶
Check that all enemies in args are dead If no args, check all enemies are dead
Types ¶
type ActionDeflect ¶
type ActionFindNearestActor ¶
type ActionFindNearestActor struct {
Actor Actor
}
type ActionMove ¶
type ActionMove struct {
X, Y float64
}
type ActionReverse ¶
type ActionReverse struct {
X, Y float64
}
type ActionShield ¶
type ActionShield struct { }
type ActionSpawnBullets ¶
type ActionSpawnBullets struct {
Bullets []*Bullet
}
type ActionSpawnEnemy ¶
type ActionSpawnParticle ¶
type ActorActions ¶
type Bullet ¶
type Bullet struct { Shape CircleShape TargetActor Actor // Target actor to head towards Speed float64 // How fastum the bullet goes Angle float64 // What angle the bullet has Acceleration float64 // How fast the bullet accelerates AccelAccel float64 // How fast the bullet accelerates its acceleration MinSpeed float64 // Minimum speed of the bullet MaxSpeed float64 // Maximum speed of the bullet AngularVelocity float64 // How fast the bullet rotates Color color.Color // Color of the bullet Lifetime int Deathtime int // Maximum lifetime of the bullet Destroyed bool Damage int // contains filtered or unexported fields }
func CreateBullet ¶
func CreateBullet( bulletType BulletType, clr color.Color, radius, speed, angle, acceleration, accelAccel, minSpeed, maxSpeed, angularVelocity float64, aimTime, aimDelay int, ) *Bullet
TODO: do this differently, hard to read and write arguments
func CreateBulletFromDef ¶
type BulletActions ¶
type BulletGroup ¶
func CreateBulletGroupFromDef ¶
func CreateBulletGroupFromDef(override, alias *resources.BulletGroup) *BulletGroup
func (*BulletGroup) SetXY ¶
func (bg *BulletGroup) SetXY(x, y float64)
func (*BulletGroup) Update ¶
func (bg *BulletGroup) Update() (actions []Action)
type BulletType ¶
type BulletType string
type Cell ¶
type Cell struct { Sprite *resources.Sprite Shape RectangleShape // contains filtered or unexported fields }
type CellCollision ¶
type CellCollision struct {
Cell Cell
}
type CircleShape ¶
func (*CircleShape) Bounds ¶
func (c *CircleShape) Bounds() (x, y, width, height float64)
func (*CircleShape) Clone ¶
func (c *CircleShape) Clone() Shape
func (*CircleShape) Collides ¶
func (c *CircleShape) Collides(s Shape) bool
type Companion ¶
type Companion struct { // Arrow *resources.Sprite Sprite *resources.Sprite Hat *resources.Sprite Hand Hand Energy int MaxEnergy int EnergyRestoreRate int TicksSinceLastInteraction int // contains filtered or unexported fields }
func (*Companion) Draw ¶
func (p *Companion) Draw(ctx states.DrawContext)
func (*Companion) DrawHand ¶
func (p *Companion) DrawHand(ctx states.DrawContext)
func (*Companion) HasEnergyFor ¶
func (*Companion) SetImpulses ¶
func (p *Companion) SetImpulses(impulses ImpulseSet)
type Enemy ¶
type Enemy struct {
// contains filtered or unexported fields
}
func (*Enemy) Draw ¶
func (e *Enemy) Draw(ctx states.DrawContext)
func (*Enemy) SetImpulses ¶
func (e *Enemy) SetImpulses(impulses ImpulseSet)
type EnemyState ¶
type EnemyState int
const ( EnemyStateHunt EnemyState = iota EnemyStateWander EnemyStateChase EnemyStateFriendly )
type GroupAngle ¶
type GroupAngle string
type Hand ¶
type Hand struct { Shape CircleShape Sprite *resources.Sprite HoverSprite *resources.Sprite }
type Hints ¶
type Hints struct {
// contains filtered or unexported fields
}
func (*Hints) ActivateGroup ¶
func (*Hints) AddHintGroup ¶
func (*Hints) DeactivateGroups ¶
func (h *Hints) DeactivateGroups()
func (*Hints) Draw ¶
func (h *Hints) Draw(ctx states.DrawContext)
type ImpulseDeflect ¶
type ImpulseDeflect struct {
X, Y float64 // X and Y are the current cursor coordinates.
}
func (ImpulseDeflect) Cost ¶
func (i ImpulseDeflect) Cost() int
func (ImpulseDeflect) Ident ¶
func (i ImpulseDeflect) Ident() uint8
func (ImpulseDeflect) ToBytes ¶
func (i ImpulseDeflect) ToBytes() (b []byte)
type ImpulseMove ¶
type ImpulseMove struct {
Direction float64
}
func (ImpulseMove) Ident ¶
func (i ImpulseMove) Ident() uint8
func (ImpulseMove) ToBytes ¶
func (i ImpulseMove) ToBytes() (b []byte)
type ImpulseReverse ¶
type ImpulseReverse struct {
X, Y float64 // X and Y are the current cursor coordinates.
}
func (ImpulseReverse) Cost ¶
func (i ImpulseReverse) Cost() int
func (ImpulseReverse) Ident ¶
func (i ImpulseReverse) Ident() uint8
func (ImpulseReverse) ToBytes ¶
func (i ImpulseReverse) ToBytes() (b []byte)
type ImpulseSet ¶
type ImpulseSet struct { Move *ImpulseMove Interaction Impulse }
func (ImpulseSet) Ident ¶
func (i ImpulseSet) Ident() uint8
func (ImpulseSet) ToBytes ¶
func (i ImpulseSet) ToBytes() (b []byte)
type ImpulseShield ¶
type ImpulseShield struct { }
func (ImpulseShield) Cost ¶
func (i ImpulseShield) Cost() int
func (ImpulseShield) Ident ¶
func (i ImpulseShield) Ident() uint8
func (ImpulseShield) ToBytes ¶
func (i ImpulseShield) ToBytes() (b []byte)
type ImpulseShoot ¶
type ImpulseShoot struct {
X, Y float64 // X and Y are the current cursor coordinates.
}
func (ImpulseShoot) Cost ¶
func (i ImpulseShoot) Cost() int
func (ImpulseShoot) Ident ¶
func (i ImpulseShoot) Ident() uint8
func (ImpulseShoot) ToBytes ¶
func (i ImpulseShoot) ToBytes() (b []byte)
type Interactive ¶
type Interactive struct {
// contains filtered or unexported fields
}
func CreateInteractive ¶
func CreateInteractive(ctx states.Context, actorDef resources.ActorSpawn) *Interactive
func (*Interactive) Active ¶
func (i *Interactive) Active() bool
func (*Interactive) AddLinkedInteractive ¶
func (i *Interactive) AddLinkedInteractive(interactives *Interactive)
func (*Interactive) Bounds ¶
func (i *Interactive) Bounds() (x, y, w, h float64)
func (*Interactive) Conditions ¶
func (i *Interactive) Conditions() []*resources.ConditionDef
func (*Interactive) Dead ¶
func (i *Interactive) Dead() bool
func (*Interactive) DecreaseActivation ¶
func (i *Interactive) DecreaseActivation(parentIds []string)
Takes parent ID to prevent infinite loops
func (*Interactive) Destroyed ¶
func (i *Interactive) Destroyed() bool
func (*Interactive) Draw ¶
func (i *Interactive) Draw(ctx states.DrawContext)
If the interactive object is active, draw the active sprite otherwise draw the inactive sprite
func (*Interactive) Hit ¶
func (i *Interactive) Hit()
func (*Interactive) ID ¶
func (i *Interactive) ID() string
func (*Interactive) IncreaseActivation ¶
func (i *Interactive) IncreaseActivation(parentIds []string)
Takes parent ID to prevent infinite loops
func (*Interactive) Player ¶
func (i *Interactive) Player() Player
func (*Interactive) Restore ¶
func (i *Interactive) Restore()
func (*Interactive) Reverseable ¶
func (i *Interactive) Reverseable() bool
func (*Interactive) Save ¶
func (i *Interactive) Save()
func (*Interactive) SetImpulses ¶
func (i *Interactive) SetImpulses(impulses ImpulseSet)
func (*Interactive) SetPlayer ¶
func (i *Interactive) SetPlayer(p Player)
func (*Interactive) SetSize ¶
func (i *Interactive) SetSize(r float64)
func (*Interactive) SetXY ¶
func (i *Interactive) SetXY(x, y float64)
func (*Interactive) Shape ¶
func (i *Interactive) Shape() Shape
func (*Interactive) Shootable ¶
func (i *Interactive) Shootable() bool
func (*Interactive) Touchable ¶
func (i *Interactive) Touchable() bool
func (*Interactive) Update ¶
func (i *Interactive) Update() []Action
type LocalPlayer ¶
type LocalPlayer struct { GamepadID int // Target gamepad for this player to use. GamepadMap string // Target mapping to use. // contains filtered or unexported fields }
LocalPlayer is a player on the local computer.
func NewLocalPlayer ¶
func NewLocalPlayer() *LocalPlayer
func (*LocalPlayer) Actor ¶
func (p *LocalPlayer) Actor() Actor
func (*LocalPlayer) ClearImpulses ¶
func (p *LocalPlayer) ClearImpulses()
func (*LocalPlayer) Hat ¶
func (p *LocalPlayer) Hat() string
func (*LocalPlayer) Impulses ¶
func (p *LocalPlayer) Impulses() ImpulseSet
Impulses is a list of impulses that the player currently desires their actor to process.
func (*LocalPlayer) QueueImpulses ¶
func (p *LocalPlayer) QueueImpulses(impulses ImpulseSet)
func (*LocalPlayer) Ready ¶
func (p *LocalPlayer) Ready(nextTick int) bool
func (*LocalPlayer) SetActor ¶
func (p *LocalPlayer) SetActor(actor Actor)
func (*LocalPlayer) SetHat ¶
func (p *LocalPlayer) SetHat(hat string)
func (*LocalPlayer) Thoughts ¶
func (p *LocalPlayer) Thoughts() Thoughts
func (*LocalPlayer) Update ¶
func (p *LocalPlayer) Update()
type Map ¶
type Map struct { Cells [][][]Cell // contains filtered or unexported fields }
func (*Map) Collides ¶
func (m *Map) Collides(s Shape) *CellCollision
func (*Map) Draw ¶
func (m *Map) Draw(ctx states.DrawContext)
func (*Map) FindCellById ¶
func (*Map) OutOfBounds ¶
type Overlay ¶
type Overlay struct {
// contains filtered or unexported fields
}
func (*Overlay) Draw ¶
func (o *Overlay) Draw(ctx states.DrawContext)
type PC ¶
type PC struct { // Arrow *resources.Sprite Sprite *resources.Sprite DeathSprite *resources.Sprite Phylactery *resources.Sprite Hat *resources.Sprite Life *resources.Sprite Hand Hand Lives int InvulnerableTicks int // Ticks the player should be invulnerable for TicksSinceLastInteraction int Energy int MaxEnergy int EnergyRestoreRate int HasDeflect bool HasShield bool // contains filtered or unexported fields }
func (*PC) Draw ¶
func (p *PC) Draw(ctx states.DrawContext)
func (*PC) DrawHand ¶
func (p *PC) DrawHand(ctx states.DrawContext)
func (*PC) HasEnergyFor ¶
func (*PC) SetImpulses ¶
func (p *PC) SetImpulses(impulses ImpulseSet)
type Player ¶
type Player interface { // ??? Ready(nextTick int) bool SetActor(actor Actor) Actor() Actor Update() Tick() Impulses() ImpulseSet ClearImpulses() QueueImpulses(impulses ImpulseSet) // Thoughts() Thoughts // SetHat(string) Hat() string }
Player represents either a local or remote player.
type QuitThought ¶
type QuitThought struct{}
func (QuitThought) Ident ¶
func (t QuitThought) Ident() uint8
func (QuitThought) ToBytes ¶
func (t QuitThought) ToBytes() (b []byte)
type RectangleShape ¶
type RectangleShape struct {
X, Y, Width, Height float64
}
func (*RectangleShape) Bounds ¶
func (r *RectangleShape) Bounds() (x, y, width, height float64)
func (*RectangleShape) Clone ¶
func (r *RectangleShape) Clone() Shape
func (*RectangleShape) Collides ¶
func (r *RectangleShape) Collides(s Shape) bool
type RemotePlayer ¶
type RemotePlayer struct {
// contains filtered or unexported fields
}
RemotePlayer is a networked player.
func NewRemotePlayer ¶
func NewRemotePlayer(peer *net.Peer) *RemotePlayer
func (*RemotePlayer) Actor ¶
func (p *RemotePlayer) Actor() Actor
func (*RemotePlayer) ClearImpulses ¶
func (p *RemotePlayer) ClearImpulses()
func (*RemotePlayer) Hat ¶
func (p *RemotePlayer) Hat() string
func (*RemotePlayer) Impulses ¶
func (p *RemotePlayer) Impulses() ImpulseSet
func (*RemotePlayer) Peer ¶
func (p *RemotePlayer) Peer() *net.Peer
func (*RemotePlayer) QueueImpulses ¶
func (p *RemotePlayer) QueueImpulses(impulses ImpulseSet)
func (*RemotePlayer) Ready ¶
func (p *RemotePlayer) Ready(nextTick int) bool
func (*RemotePlayer) SetActor ¶
func (p *RemotePlayer) SetActor(actor Actor)
func (*RemotePlayer) SetHat ¶
func (p *RemotePlayer) SetHat(hat string)
func (*RemotePlayer) Thoughts ¶
func (p *RemotePlayer) Thoughts() Thoughts
func (*RemotePlayer) Tick ¶
func (p *RemotePlayer) Tick()
func (*RemotePlayer) Update ¶
func (p *RemotePlayer) Update()
type ResetThought ¶
type ResetThought struct{}
func (ResetThought) Ident ¶
func (t ResetThought) Ident() uint8
func (ResetThought) ToBytes ¶
func (t ResetThought) ToBytes() (b []byte)
type Snaggable ¶
type Snaggable struct {
// contains filtered or unexported fields
}
func (*Snaggable) Draw ¶
func (s *Snaggable) Draw(ctx states.DrawContext)
func (*Snaggable) SetImpulses ¶
func (s *Snaggable) SetImpulses(impulses ImpulseSet)
type Spawner ¶
type Spawner struct {
// contains filtered or unexported fields
}
This can probably be attached to an actor instead being its own actor
func CreateSpawner ¶
func CreateSpawner(ctx states.Context, bulletGroupDefs []*resources.BulletGroup) *Spawner
func (*Spawner) Draw ¶
func (s *Spawner) Draw(states.DrawContext)
func (*Spawner) SetImpulses ¶
func (s *Spawner) SetImpulses(impulses ImpulseSet)
type Thought ¶
Thoughts are a poorly named notion that sits above Impulses. These can effectively be viewed as player desires/commands and are sent across the wire between clients.
type TickState ¶
type TickState struct { Thoughts Thoughts Impulses ImpulseSet }
type World ¶
type World struct { Players []Player // Exposed so singleplayer/multiplayer can set it. StartingMap string ShowHints bool Net net.ServerClient Seed int64 Difficulty *states.Difficulty // contains filtered or unexported fields }
func (*World) ArePlayersDead ¶
func (*World) CurrentState ¶
func (s *World) CurrentState() WorldState
func (*World) DoPlayersShareThought ¶
func (*World) Draw ¶
func (s *World) Draw(ctx states.DrawContext)
func (*World) HandleTrash ¶
func (s *World) HandleTrash()
func (*World) IntersectingActors ¶
func (*World) IntersectingBullets ¶
func (*World) PlayerFromPeer ¶
func (s *World) PlayerFromPeer(peer *net.Peer) *RemotePlayer
func (*World) SpawnParticle ¶
type WorldState ¶
type WorldStateBegin ¶
type WorldStateBegin struct {
// contains filtered or unexported fields
}
func (*WorldStateBegin) Draw ¶
func (w *WorldStateBegin) Draw(s *World, ctx states.DrawContext)
type WorldStateDead ¶
type WorldStateDead struct { }
func (*WorldStateDead) Draw ¶
func (w *WorldStateDead) Draw(s *World, ctx states.DrawContext)
type WorldStateEnd ¶
type WorldStateEnd struct {
// contains filtered or unexported fields
}
func (*WorldStateEnd) Draw ¶
func (w *WorldStateEnd) Draw(s *World, ctx states.DrawContext)
type WorldStateLive ¶
type WorldStateLive struct {
// contains filtered or unexported fields
}
func (*WorldStateLive) Draw ¶
func (w *WorldStateLive) Draw(s *World, ctx states.DrawContext)
Source Files ¶
- action.go
- actor.go
- bullet.go
- bulletgroup.go
- companion.go
- conditions.go
- enemy.go
- hand.go
- hints.go
- impulse.go
- interactive.go
- localplayer.go
- map.go
- overlay.go
- particle.go
- pc.go
- player.go
- remoteplayer.go
- shape.go
- snaggable.go
- spawner.go
- thought.go
- world.go
- wstate.go
- wstate_begin.go
- wstate_dead.go
- wstate_end.go
- wstate_live.go