public void update () {
		for ( int i = 0; i < numUsed; i++ ) {
			int p = ( (firstUsed+i) % MAX_PARTS ) * NUM_FIELDS;
			if ( particles[ p + FIELD_L ] > 0 ) {
				if ( particles[ p + FIELD_A ] <= 0 ) {
					// Die if alpha <= 0
					particles[ p + FIELD_L ] = 0;
					
				} else {
					// Update position
					particles[ p + FIELD_X ] += particles[ p + FIELD_XS ];
					particles[ p + FIELD_Y ] += particles[ p + FIELD_YS ];
					
					// Update speed
					particles[ p + FIELD_XS ] += particles[ p + FIELD_XA ];
					particles[ p + FIELD_YS ] += particles[ p + FIELD_YA ];
					
					// Update alpha and life
					particles[ p + FIELD_A ] += particles[ p + FIELD_AS ];
					particles[ p + FIELD_L ]--;
				}
			}
		}
		
		// Remove particles with life == 0 from the beginning
		while ( numUsed > 0 && particles[ ( firstUsed * NUM_FIELDS ) + FIELD_L ] == 0 ) {
			firstUsed = ( firstUsed + 1 ) % MAX_PARTS;
			numUsed--;
		}
		
		// Remove particles with life == 0 from the end
		while ( numUsed > 0 && particles[ ( ( ( firstUsed + numUsed - 1 ) % MAX_PARTS ) * NUM_FIELDS ) + FIELD_L ] == 0 )
		{
			numUsed--;
		}
	}