Example #1
0
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}
}
Example #2
0
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()
}
Example #3
0
File: mouse.go Project: kbatten/noc
func (self *Mouse) Step() {
	self.location = noc.NewPVector(self.context.MouseLocation())

	self.limitLocation()
}