func NewWorldItem(kind Item, pos coords.World) *WorldItem { globalWorldItemId++ return &WorldItem{ worldItemState: WorldItemState{ EntityState: EntityState{ EntityId: EntityId("worldItem" + strconv.FormatUint(globalWorldItemId, 10)), Body: physics.Body{ Pos: pos.Vec3(), HalfExtents: WorldItemHalfExtents, }, }, ItemKind: kind, }, history: NewHistoryBuffer(), } }
func (p *Player) Respawn(pos coords.World) { p.bioticState.EntityState.Body.Pos = pos.Vec3() p.bioticState.Health.Life = PLAYER_MAX_LIFE p.history.Clear() p.history.Add(p.LastUpdated(), p.Body()) }