Documentation ¶
Index ¶
- Constants
- type Creature
- func (host *Creature) AddAntenna(antType int) *antenna
- func (host *Creature) AddBoosters() (*booster, *booster)
- func (host *Creature) AddMouth() *mouth
- func (host *Creature) AddPulser() *pulser
- func (cx *Creature) Breed(cy *Creature) *Creature
- func (c *Creature) Check() bool
- func (c *Creature) Clone() *Creature
- func (c *Creature) Color() color.RGBA
- func (c *Creature) Consume() float64
- func (c *Creature) Prepare()
- func (c *Creature) Radius() float64
- func (c *Creature) Work()
Constants ¶
View Source
const ( // Antenna types. AntennaLeft = 1 AntennaRight = 2 )
Fixed values.
View Source
const ( // Booster types. BoosterLinear = 1 BoosterAngular = 2 // Velocity scaling. Linear is in pixels, but rotation is in radians - so scale the latter down. LinPerAng = 10 // Maximum velocity. MaxLinVel = 1.0 MaxAngVel = MaxLinVel / LinPerAng )
Fixed values.
View Source
const ( MaxVitality = 600 InitialVitality = 300 SpeedDegredation = 0.9 )
Fixed values.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Creature ¶
type Creature struct {
// contains filtered or unexported fields
}
The high-level creature struct.
func (*Creature) AddAntenna ¶
Add a new antenna object to a creature.
func (*Creature) AddBoosters ¶
func (host *Creature) AddBoosters() (*booster, *booster)
Add a standard set of boosters to a host; one angular and one linear.
func (*Creature) AddMouth ¶
func (host *Creature) AddMouth() *mouth
Add a new mouth to a creature. This is at the front of the creature.
func (*Creature) AddPulser ¶
func (host *Creature) AddPulser() *pulser
Add a new pulser to a creature.
func (*Creature) Check ¶
Check the status of the creature and update LM appropriately. Returns a boolean for whether teardown occured.
func (*Creature) Prepare ¶
func (c *Creature) Prepare()
Generates a new random DNA string for a creature and injects it into the brain. Must be called AFTER all outputs and inputs have been added.
Click to show internal directories.
Click to hide internal directories.