src/js/lib/letterAnimation.js
/**
   * Update the individual letter animations one at a time (frame by frame)
   * until complete (or there isn't enough delta left to proceed to the
   * next frame). Keeps track of remainder delta for next call to update.
   *.
   * @returns true if there still are letters to animate
   */
Update the individual letter animations one at a time (frame by frame)
until complete (or there isn't enough delta left to proceed to the
next frame). Keeps track of remainder delta for next call to update.
.
@returns true if there still are letters to animate
Update the individual letter animations one at a time ( frame by frame ) until complete ( or there isn ' t enough delta left to proceed to the next frame ) . Keeps track of remainder delta for next call to update . . @returns true if there still are letters to animate
update(delta) {
		delta += this._remainder;
		while (this._remainingLetters.length > 0 && delta >= SECS_PER_FRAME) {
			const letter = this._remainingLetters[this._remainingLetters.length - 1];
			if (!letter.step()) {
				this._remainingLetters.pop();
			} else {
				delta -= SECS_PER_FRAME;
			}
		}
		this._remainder = delta;
		return this._remainingLetters.length > 0;
	}
update ( delta ) { delta += this . _remainder ; while ( this . _remainingLetters . length > 0 && delta >= SECS_PER_FRAME ) { const letter = this . _remainingLetters [ this . _remainingLetters . length - 1 ] ; if ( ! letter . step ( ) ) { this . _remainingLetters . pop ( ) ; } else { delta -= SECS_PER_FRAME ; } } this . _remainder = delta ; return this . _remainingLetters . length > 0 ; }
Update the individual letter animations one at a time (frame by frame)
 until complete (or there isn't enough delta left to proceed to the
 next frame).
Update the individual letter animations one at a time ( frame by frame ) until complete ( or there isn ' t enough delta left to proceed to the next frame ) .
// Include sub SEC_PER_FRAME time from last update // When letters don't animate, they are offscreen. So, we can // proceed to animating the next letter // We discretize the delta into frames of length SEC_PER_FRAME // Keep track of any leftover time for the next update