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

	self.limitLocation()
}