|
|
|
@ -157,8 +157,8 @@ Particle.prototype.updateLeader = function(particles) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Head-to-head: particles see eachother but shouldn't both lead.
|
|
|
|
|
if (this.leader === null && particles.length > 0) { |
|
|
|
|
// Head-to-head: particles see eachother but shouldn't both lead.
|
|
|
|
|
const candidates = particles |
|
|
|
|
.filter(v => v.leader ? (v.leader.id !== this.id) : true); |
|
|
|
|
|
|
|
|
@ -301,6 +301,8 @@ function updateVisionGrid(arc, config, grids) { |
|
|
|
|
function repaintContainer(node, arc, leaderTime) { |
|
|
|
|
node.style.left = `${arc.endX}px`; |
|
|
|
|
node.style.top = `${arc.endY}px`; |
|
|
|
|
|
|
|
|
|
node.style.zIndex = (leaderTime > 0 ? 2000 : 2); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function repaintBody(node, arc, leaderTime) { |
|
|
|
@ -309,6 +311,8 @@ function repaintBody(node, arc, leaderTime) { |
|
|
|
|
: RAD.t360 - arc.theta; |
|
|
|
|
|
|
|
|
|
node.style.transform = `rotate(${rad + RAD.t45}rad)`; |
|
|
|
|
|
|
|
|
|
node.style.border = (leaderTime > 0 ? '3px dotted #fff' : ''); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function repaintCircle(node, arc) { |
|
|
|
|