func newMover(x, y float64, context *httpcanvas.Context) *Mover { return &Mover{noc.NewPVector(x, y), noc.NewPVector(0, 0), noc.NewPVector(0, 0), "rgba(0, 175, 0, 0.75)", 20, context} }
func (self *Vehicle) Step() { target := noc.NewPVector(self.context.MouseLocation()) self.Seek(target) self.limitAcceleration() self.velocity.Add(self.acceleration) self.limitVelocity() self.location.Add(self.velocity) self.limitLocation() }
func (self *Mouse) Step() { self.location = noc.NewPVector(self.context.MouseLocation()) self.limitLocation() }