LordXido commited on
Commit
c73d07c
·
verified ·
1 Parent(s): 5e079cb

Create agents.js

Browse files
Files changed (1) hide show
  1. agents.js +9 -0
agents.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ let agents=[];
2
+
3
+ export function spawnAgent(){
4
+ agents.push({x:Math.random(),y:Math.random(),energy:1});
5
+ }
6
+
7
+ export function updateAgents(){
8
+ agents.forEach(a=>a.energy*=0.999);
9
+ }