function updateCountdownTimer(){
  const nextMonsterAt = new Date(Epoch.valueOf() + (86400000 * DayNumber));
  const timeToNext = (nextMonsterAt - new Date()) / 1000;
  if(timeToNext < 0){
    countdownTimer.data.timeToNext = '<strong class="anim-vibrate">On the way!</strong>'
    State.data.gameOver = true;
    if(app){
      app.data.dialogStats = true;
      app.data.toast = '<strong style="font-size: 200%">A new monster is coming!</strong>';
    }
    setTimeout(()=>window.location.reload(), 4000);
    return;
  }
  const hours = Math.floor(timeToNext / 3600);
  const mins = Math.floor((timeToNext - (hours * 3600)) / 60);
  const secs = Math.floor(timeToNext % 60);
  countdownTimer.data.timeToNext = `${("0" + hours).substr(-2, 2)}:${("0" + mins).substr(-2, 2)}:${("0" + secs).substr(-2, 2)}`;
}
// Update countdown timer now and every second
Update countdown timer now and every second
Update countdown timer now and every second
function updateCountdownTimer(){
  const nextMonsterAt = new Date(Epoch.valueOf() + (86400000 * DayNumber));
  const timeToNext = (nextMonsterAt - new Date()) / 1000;
  if(timeToNext < 0){
    countdownTimer.data.timeToNext = '<strong class="anim-vibrate">On the way!</strong>'
    State.data.gameOver = true;
    if(app){
      app.data.dialogStats = true;
      app.data.toast = '<strong style="font-size: 200%">A new monster is coming!</strong>';
    }
    setTimeout(()=>window.location.reload(), 4000);
    return;
  }
  const hours = Math.floor(timeToNext / 3600);
  const mins = Math.floor((timeToNext - (hours * 3600)) / 60);
  const secs = Math.floor(timeToNext % 60);
  countdownTimer.data.timeToNext = `${("0" + hours).substr(-2, 2)}:${("0" + mins).substr(-2, 2)}:${("0" + secs).substr(-2, 2)}`;
}
function updateCountdownTimer ( ) { const nextMonsterAt = new Date ( Epoch . valueOf ( ) + ( 86400000 * DayNumber ) ) ; const timeToNext = ( nextMonsterAt - new Date ( ) ) / 1000 ; if ( timeToNext < 0 ) { countdownTimer . data . timeToNext = '<strong class="anim-vibrate">On the way!</strong>' State . data . gameOver = true ; if ( app ) { app . data . dialogStats = true ; app . data . toast = '<strong style="font-size: 200%">A new monster is coming!</strong>' ; } setTimeout ( ( ) => window . location . reload ( ) , 4000 ) ; return ; } const hours = Math . floor ( timeToNext / 3600 ) ; const mins = Math . floor ( ( timeToNext - ( hours * 3600 ) ) / 60 ) ; const secs = Math . floor ( timeToNext % 60 ) ; countdownTimer . data . timeToNext = ` ${ ( "0" + hours ) . substr ( - 2 , 2 ) } ${ ( "0" + mins ) . substr ( - 2 , 2 ) } ${ ( "0" + secs ) . substr ( - 2 , 2 ) } ` ; }
Update countdown timer now and every second
Update countdown timer now and every second