set initial values for delayTime and previousFrame