Versions in this module Expand all Collapse all v1 v1.0.0 Oct 3, 2023 Changes in this version + const AffectedByGravityKey + const BoundLocationKey + const CanExplodeKey + const ExplosionRadius + const FrameEndDeleteKey + const KeepInCameraKey + const LookupKey + const MissileDetailsKey + const MomentumKey + const NetworkIdKey + const NetworkReceiveKey + const NetworkTransmitKey + const ParticleSunDeleteKey + const PointRenderKey + const PosKey + const RotKey + const ShipControlKey + const SpinKey + const SpriteEnemyShip + const SpriteExplosionFlash + const SpriteKey + const SpriteMissile + const SpriteShip + const SpriteStar + const SpriteStarBit + const SpriteUnset + const TimedDestroyKey + const TimedExplodeKey + type Comp interface + Extend func(i int) + RemoveLast func() + Swap func(j1, j2 int) + type CompKey uint16 + type Entities struct + func (e *Entities) NewIter() *Iter + type EntityBag struct + Lookup *comp_Lookup + MissileDetails *comp_MissileDetails + Momentum *comp_Vec2 + NetworkId *comp_uint64 + Pos *comp_Vec2 + Rot *comp_float32 + ShipControl *comp_ShipControl + Spin *comp_float32 + Sprite *comp_Sprite + TimedDestroy *comp_float32 + TimedExplode *comp_float32 + func (e *EntityBag) Add(i int) int + func (e *EntityBag) Remove(i int) + type ExplosionDetails struct + Initialized bool + MoreExplosions bool + type Game struct + ControlledShip *Lookup + E *Entities + NetworkIds map[uint64]*Lookup + NextNetworkId uint64 + func NewGame() *Game + func (g *Game) NextNid() uint64 + func (g *Game) Step(input *Input) + type Input struct + Cid int64 + Down Keystate + Dt float32 + Fire Keystate + IsConnected bool + IsHost bool + IsPlayer bool + IsRendered bool + Left Keystate + Memos []*pb.Memo + MemosOut []*pb.Memo + Right Keystate + Up Keystate + func NewInput() *Input + func (i *Input) BroadcastAll(actual proto.Message) + func (i *Input) BroadcastOthers(actual proto.Message) + func (i *Input) SendMemo(partial *pb.Memo, actual proto.Message) + func (i *Input) SendTo(to int64, actual proto.Message) + func (inp *Input) FrameEndReset() + type Iter struct + func (iter *Iter) Get(indices *Lookup) + func (iter *Iter) Lookup() *Lookup + func (iter *Iter) MissileDetails() *MissileDetails + func (iter *Iter) Momentum() *Vec2 + func (iter *Iter) NetworkId() *uint64 + func (iter *Iter) New() + func (iter *Iter) Next() bool + func (iter *Iter) Pos() *Vec2 + func (iter *Iter) Remove() + func (iter *Iter) Require(k CompKey) + func (iter *Iter) Rot() *float32 + func (iter *Iter) ShipControl() *ShipControl + func (iter *Iter) Spin() *float32 + func (iter *Iter) Sprite() *Sprite + func (iter *Iter) TimedDestroy() *float32 + func (iter *Iter) TimedExplode() *float32 + type Keystate struct + Hold bool + Press bool + Release bool + func (k *Keystate) Down() + func (k *Keystate) FrameEndReset() + func (k *Keystate) Up() + type Lookup [2]int + func (l *Lookup) Alive() bool + type MissileDetails struct + Owner *Lookup + type PlayerConnectedEvent struct + type ShipControl struct + Down bool + Fire bool + FireCoolDown float32 + Left bool + Right bool + Up bool + type Sprite uint16 + type Vec2 [2]float32 + func Vec2FromProto(p *pb.Vec2) Vec2 + func Vec2FromRadians(rad float32) Vec2 + func (v *Vec2) AddEqual(o Vec2) + func (v *Vec2) Length() float32 + func (v *Vec2) ToProto() *pb.Vec2 + func (v Vec2) Add(o Vec2) Vec2 + func (v Vec2) Dot(o Vec2) float32 + func (v Vec2) Normalize() Vec2 + func (v Vec2) Scale(s float32) Vec2 + func (v Vec2) Sub(o Vec2) Vec2