示例#1
0
func NewTvNode(t lib.Torus) *lib.SimNode {
	tv := &Tv{}
	tv.R = 3
	tv.InvF = 3
	n := lib.EmptyNode()
	n.Entity = tv
	n.Name = "tv"
	n.P = randPlace(t)
	return n
}
示例#2
0
func NewSheepleNode(t lib.Torus) *lib.SimNode {
	sh := &Sheeple{}
	sh.D = lib.Vec2(1.0, 0)
	sh.S = 1.0
	n := lib.EmptyNode()
	n.Entity = sh
	n.Name = "sheeple"
	n.P = randPlace(t)
	sh.LastP = lib.Vec2(0, 0)
	sh.wander(n, t)
	sh.wander(n, t)
	return n
}