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

	self.limitLocation()
}