class Drop { float dropx, dropy; int dropa = int( random( 100)); Drop( int ix, int iy) { dropx = ix; dropy = iy; } void draw() { fill( 10, 15, 70, dropa); ellipse( dropx, dropy, 20, 20); dropy++; if( dropy>=height+20) { dropy=-20; } dropa--; if( dropa<0) { dropx = int( random( width)); dropy = int( random( height)); dropa=100; } } } class Now { int nowy,nowmo,nowd,nowh,nowmi,nows,nowms; // now now int onowy,onowmo,onowd,onowh,onowmi,onows,onowms; // original now int msecondsDelta; // number of seconds passed int resetAtmSeconds; Now() { onowy = year(); onowmo = month(); onowd = day(); onowh = hour(); onowmi = minute(); onows = second(); onowms = millis(); nowy = 0; nowmo = 0; nowd = 0; nowh = 0; nowmi = 0; nows = 0; nowms = 0; } void reset() { onowms = onowms-resetAtmSeconds; } boolean timer(int iresetAtmSeconds) { resetAtmSeconds = iresetAtmSeconds; nowy = year(); nowmo = month(); nowd = day(); nowh = hour(); nowmi = minute(); nows = second(); nowms = millis(); msecondsDelta = (nowy - onowy) * 1000 * 60 * 60 * 24 * 31 * 12; msecondsDelta += (nowmo - onowmo) * 1000 * 60 * 60 * 24 * 31; msecondsDelta += (nowd - onowd) * 1000 * 60 * 60 * 24; msecondsDelta += (nowh - onowh) * 1000 * 60 * 60; msecondsDelta += (nowmi - onowmi) * 1000 * 60; msecondsDelta += (nows - onows) * 1000 ; msecondsDelta += (nowms - onowms) ; if( msecondsDelta > resetAtmSeconds) { onowy = nowy; onowmo = nowmo; onowd = nowd; onowh = nowh; onowmi = nowmi; onows = nows; onowms = nowms; return true; } else { return false; } } }