File size: 179 Bytes
c73d07c
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
let agents=[];

export function spawnAgent(){
  agents.push({x:Math.random(),y:Math.random(),energy:1});
}

export function updateAgents(){
  agents.forEach(a=>a.energy*=0.999);
}