use of spacegraph.space2d.phys.common.Vec2 in project narchy by automenta.
the class AbstractPolygonBot method eat.
public void eat(Body eaten) {
Material m = (Material) eaten.getUserData();
if (m instanceof Sim.FoodMaterial) {
nar.input("<goal --> [food]>. :|: %0.90;0.90%");
nar.input("<goal --> [health]>. :|: %0.90;0.90%");
} else if (m instanceof Sim.PoisonMaterial) {
nar.input("<goal --> [food]>. :|: %0.00;0.90%");
nar.input("<goal --> [health]>. :|: %0.00;0.90%");
} else {
return;
}
@Deprecated int sz = 48;
float x = (float) Math.random() * sz - sz / 2f;
float y = (float) Math.random() * sz - sz / 2f;
// random new position
eaten.setTransform(new Vec2(x * 2.0f, y * 2.0f), eaten.getAngle());
}
Aggregations