class WebcamMan { float x,y; float speed, targetSpeed; float scl; float freq, bounce; float armSwing, legSwing; float goChance, stopChance, revDirChance; float ms; float targetTimeFac = 1.0; float timeFac = 1.0; boolean walk = true; WebcamMan(float _x, float _y, float _speed, float _scl,float _freq,float _bounce,float _arm, float _leg, float go, float stop, float revDir) { x=_x; y=_y; speed = _speed; scl = _scl; freq = _freq; bounce = _bounce; armSwing = _arm; legSwing = _leg; goChance = go; stopChance = stop; revDirChance = revDir; ms =0; } void stop() { targetTimeFac = 0; } void go() { targetTimeFac = 1.0; } void revDir() { targetTimeFac *= -1; } void draw(float step) { timeFac = 0.9*timeFac+0.1*targetTimeFac; x+=timeFac*step*speed; if (x<-50) x=width+50; else if (x>width+50) x=-50; ms += timeFac*step*40; if (walk) { walk = random(1.0)>stopChance; if (!walk) stop(); } else { walk = random(1.0)