-
... ].rand, RedVector2D[0, 0], 1.5, 10) }.dup(n); //world,loc,vel,acc,mass,size //--loop w.draw{ Pen.strokeColor= Color.green; rep.loc= w.mouse; Pen.strokeRect(Rect.aboutRedObject2D(rep)); Pen.strokeColor= Color.white; world.objects.do{|o| if(o ...
-
... d,loc,vel,acc,mass,size .theta_(2pi.rand).angularVel_(1.5.rand2); }.dup(n); //--loop w.draw{ Pen.strokeColor= Color.white; Pen.width= 1; world.objects.do{|o, i| world.objects.do{|oo, j| if(i!=j, { o.addForceAngular2D(o.gravityForce(oo)); }) ...
-
... ss, mass*5) //world,loc,vel,acc,mass,size .maxForce_(1.rrand(6)); }.dup(n); //--loop w.draw{ world.objects.do{|o, i| if(i!=0, { o.addForceWander2D; o.addForceSeek(world.objects[0].loc); }, { o.addForceWander2D; }); o.addForce(world.gravity) ...
-
... [0.001, 0.001], nil, mass, mass*5); //world,loc,vel,acc,mass,size }.dup(n); //--loop w.draw{ Pen.strokeColor= Color.grey(0.75, 0.5); Pen.width= 2; world.objects.do{|o, i| o.addForce(world.gravity); o.addForce(o.frictionForce(-0.3)); o.updat ...
-
... height*0.4, width, 40); //area with friction ff= -0.5; //amount of friction //--loop w.draw{ if(fric.containsPoint(obj.loc.asPoint), { if(obj.vel.mag>0 and:{obj.vel.mag>obj.frictionForce(ff).mag}, { obj.addForce(obj.frictionForce(ff)); }, { ...
-
... e { arg inval; var outval, dropSize, current, rewritten, count=0; current = ""; loop { outval = this.next(inval); count = count + 1; if(outval.notNil) { current = current ++ outval; } { if(current.size == 0) { inval = nil.yield }; }; if( cu ...
-
... ack volume 'env' - attack and release time in seconds 'bus' - output bus index 'loop' - keep repeating the soundfile. note: not smooth because of file preloading 'folder' - select a file to set path to all soundfiles. it is also possible to ...
-
... atDef( \p_map_point, { |unit, x = 0, y = 0, center = (0@0), radius = (10@10)| { loop { ([x.next, y.next] * radius.next.asArray + center.next.asArray).asPoint.yield }; }.r }).category_( 'pattern_point' ) .valueIsMapped_( false ) .numChannels ...
-
... ld, loc, RedVector2D[0, 0], RedVector2D[0.5, 0.5], mass, mass*5); }.dup(n); //--loop w.draw{ world.objects.do{|o, i| world.objects.do{|oo, j| if(i!=j, { //do not attract yourself o.addForce(o.gravityForce(oo)); //add gravity from all other ...
-
... 0, 0], mass, mass*5) //world,loc,vel,acc,mass,size .maxForce_(2); }.dup(n); //--loop w.draw{ world.objects.do{|o, i| if(i!=0, { o.addForceSeek(world.objects[0].loc); //o.addForceArrive(world.objects[0].loc, 100); //everybody chase first boi ...