Documentation ¶
Index ¶
- func Distance(v1, v2 pixel.Vec) float64
- func ManDist(v1, v2 pixel.Vec) float64
- func Sqrt(x float64) float64
- type Being
- type Beings
- type Object
- type P
- type Tile
- func (t *Tile) Copy(newtileset Tileset) *Tile
- func (t *Tile) Down() *Tile
- func (t *Tile) Left() *Tile
- func (t *Tile) ManhattanDistance(to astar.Pather) float64
- func (t *Tile) PathEstimatedCost(to astar.Pather) float64
- func (t *Tile) PathNeighborCost(to pathfinder.Pather) float64
- func (t *Tile) PathNeighbors() pathfinder.Pathers
- func (t *Tile) PathTo(t2 *Tile) (pathfinder.Pathers, float64, bool)
- func (t *Tile) Pos() pixel.Vec
- func (t *Tile) Right() *Tile
- func (t *Tile) SetTileset(newtileset Tileset)
- func (t *Tile) Up() *Tile
- type Tileset
- type World
- func (w *World) Batch(b Beings)
- func (w *World) BatchFn(fn func(b Being) error) error
- func (w *World) DealDamage(fromPlayer uint64, toPlayer uint64, amount float64) (healthAfter float64)
- func (w *World) Get(uid uint64) Being
- func (w *World) GetTile(at pixel.Vec) *Tile
- func (w *World) Len() int
- func (w *World) NewTile(tiletype types.Type, x, y float64) *Tile
- func (w *World) Remove(playerid uint64)
- func (w *World) SetTile(t *Tile)
- func (w *World) SnapshotBeings() Beings
- func (w *World) Update(b Being) (isNew bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Being ¶
type Being interface { ID() uint64 X() float64 Y() float64 Type() types.Type MoveTo([2]float64) Health() float64 SetHealth(float64) DealDamage(from uint64, damage float64) (healthAfter float64) }
Being / Entity: a thing with distinct and independent existence. also see Object
type Tile ¶
type Tile struct {
X, Y float64
MovementCost float64
Type types.Type
// contains filtered or unexported fields
}
func (*Tile) ManhattanDistance ¶
func (*Tile) PathEstimatedCost ¶
func (*Tile) PathNeighborCost ¶
func (t *Tile) PathNeighborCost(to pathfinder.Pather) float64
func (*Tile) PathNeighbors ¶
func (t *Tile) PathNeighbors() pathfinder.Pathers
func (*Tile) SetTileset ¶
Click to show internal directories.
Click to hide internal directories.