animal

package
v0.0.0-...-8b39f33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Herbivore

type Herbivore struct {
	Body       phys.Body
	Anim       sprite.Anim
	ThinkGroup uint
}

Herbivore is a struct representing basic herding, non-agressive, herbivorous animals.

type Herbivores

type Herbivores struct {
	Info  *Info
	Herbs []*Herbivore
}

func MakeHerbivores

func MakeHerbivores(name string) (Herbivores, error)

func (Herbivores) Boid

func (hs Herbivores) Boid(n int) ai.Boid

func (Herbivores) BoidInfo

func (hs Herbivores) BoidInfo() ai.BoidInfo

func (Herbivores) Draw

func (hs Herbivores) Draw(d ui.Drawer, cam ui.Camera)

func (Herbivores) Len

func (hs Herbivores) Len() int

func (Herbivores) Move

func (hs Herbivores) Move(w *world.World)

func (*Herbivores) Spawn

func (hs *Herbivores) Spawn(p, v geom.Point)

Spawn spawns a new Herbivore for this Herbivores collection.

type Info

type Info struct {
	Name     string
	Sheet    sprite.Sheet
	Affinity map[string]float64
	BoidInfo ai.BoidInfo
}

Info contains the properties for an entire species of animal.

func LoadInfo

func LoadInfo(s string) (Info, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL