Guest User

Untitled

a guest
Jul 15th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. let targetXLymphocyte = function (creature) {
  2. let cohesion = creature.cohesion(world.bacterias);
  3. return cohesion.x / world.width;
  4. }
  5.  
  6. let targetYLymphocyte = function (creature) {
  7. let cohesion = creature.cohesion(world.bacterias);
  8. return cohesion.y / world.height;
  9. }
  10.  
  11. let targetAngleLymphocyte = function (creature) {
  12. let alignment = creature.align(world.bacterias);
  13. return (alignment.angle() + Math.PI) / (Math.PI * 2);
  14. }
Add Comment
Please, Sign In to add comment