Documentation ¶
Index ¶
- func Teleport(pos, edge float64) float64
- type Arrow
- type Boid
- type Data
- type Square
- type Triangle
- func (t *Triangle) Add(vector v.Vector2D, points ...*v.Vector2D)
- func (t *Triangle) Apply(*v.Vector2D, *v.Vector2D)
- func (t *Triangle) Coords() v.Vector2D
- func (t *Triangle) Draw(screen *ebiten.Image)
- func (t *Triangle) TrianglePointsMake(x, y float64)
- func (t *Triangle) Update(sx, sy float64, population []Boid, index int, info chan *Data)
- func (t *Triangle) Velocity() v.Vector2D
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Arrow ¶
type Arrow struct { ImageWidth int ImageHeight int SightDis float64 SightAngle float64 Pos *v.Vector2D Vel *v.Vector2D Accel *v.Vector2D Image *ebiten.Image }
type Square ¶
type Triangle ¶
type Triangle struct { ImageWidth int ImageHeight int SightAngle float64 SightDis int // Distance that boid can see in front of it Theta float64 // Angle that the Velocity vectors create. VelTheta float64 // Angle that the Acceleration vectors create. Top *v.Vector2D // Vertex of the initial top point Left *v.Vector2D // Vertex of the initial left point Right *v.Vector2D // Vertex of the initial right point Vel *v.Vector2D Accel *v.Vector2D }
Triangle is an image object for the game screen. It satisfies the boid interface.
func (*Triangle) TrianglePointsMake ¶
TrianglePointsMake uses (x, y) as coordinates of the top. Finds the Right and Left Point using ImageWidth, ImageHeight, and (x, y).
Click to show internal directories.
Click to hide internal directories.