@@ -3,8 +3,8 @@ var Agent = function(noiseStickingRange, agentAlpha, noiseScale, noiseStrength,
33 this . vectorOld = this . vector . copy ( ) ;
44 this . randomizer = myp5 . random ( ) ;
55 this . stepSize = 1 + this . randomizer * 4 ;
6- this . zNoise = myp5 . random ( noiseStickingRange ) ;
7- this . angle ;
6+ this . noiseZ = myp5 . random ( noiseStickingRange ) ;
7+ this . angle = 0
88 this . color = this . randomizer < 0.5 ? myp5 . color ( myp5 . random ( 170 , 190 ) , 70 , myp5 . random ( 100 ) , agentAlpha ) : myp5 . color ( myp5 . random ( 40 , 60 ) , 70 , myp5 . random ( 100 ) , agentAlpha ) ;
99 this . noiseScale = noiseScale ;
1010 this . noiseStrength = noiseStrength ;
@@ -39,7 +39,7 @@ Agent.prototype.update1 = function() {
3939 myp5 . strokeWeight ( this . strokeWidth ) ;
4040 myp5 . line ( this . vectorOld . x , this . vectorOld . y , this . vector . x , this . vector . y ) ;
4141
42- var agentWidth = myp5 . lerp ( this . agentWidthMin , this . agentWidthMax , this . randomizer ) ;
42+ var agentWidth = myp5 . map ( this . randomizer , 0.1 , 1 , this . agentWidthMin , this . agentWidthMax ) ;
4343 myp5 . push ( ) ;
4444 myp5 . translate ( this . vectorOld . x , this . vectorOld . y ) ;
4545 myp5 . rotate ( myp5 . atan2 ( this . vector . y - this . vectorOld . y , this . vector . x - this . vectorOld . x ) ) ;
@@ -54,7 +54,7 @@ Agent.prototype.update2 = function() {
5454
5555 myp5 . stroke ( this . color ) ;
5656 myp5 . strokeWeight ( 2 ) ;
57- var agentWidth = myp5 . lerp ( this . agentWidthMin , this . agentWidthMax , this . randomizer ) * 2 ;
57+ var agentWidth = myp5 . map ( this . randomizer , 0.1 , 1 , this . agentWidthMin , this . agentWidthMax ) * 2 ;
5858 myp5 . ellipse ( this . vectorOld . x , this . vectorOld . y , agentWidth , agentWidth ) ;
5959
6060 this . updateEnd ( ) ;
0 commit comments