Minor cleanups.

master
Ben Burlingham 8 years ago
parent 85208e9063
commit 6520435afa
  1. 3
      js/arc.js
  2. 6
      js/bundle.js
  3. 9
      js/index.js
  4. 5
      js/particle.js

@ -161,7 +161,8 @@ const Arc = {
},
evade: function(arc) {
arc = Arc.changeRadius(arc, 15);
// Randomness here mitigates sticking in corners and between walls.
arc = Arc.changeRadius(arc, Random.num(15, 30));
arc.length = 0.3;
return arc;

File diff suppressed because one or more lines are too long

@ -29,11 +29,4 @@ window.addEventListener('load', () => {
});
// TODO remove bottom padding from Disqus
// TODO sort out particle nextframe
// INTERESTING CONTROLS:
// sensitivity
// rigidity
// show leaders
// TURN THE CORRECT DIRECTION - HUGE EFFICIENCY INCREASE
// TODO TURN THE CORRECT DIRECTION - HUGE EFFICIENCY INCREASE

@ -210,19 +210,20 @@ function look(arc, grids) {
const { global, vision } = grids;
return vision.reduce((acc, point) => {
point.touch = false;
const x = arc.endX + point.x;
const y = arc.endY + point.y;
const p = global.getPoint({ x, y, type: ENTITIES.PARTICLE });
if (p) {
acc.particles.push(p);
point.touch = true;
}
if (global.getPoint({ x, y, type: ENTITIES.HAZARD })) {
acc.hazards.push({ x, y });
point.touch = true;
} else {
point.touch = false;
}
return acc;

Loading…
Cancel
Save