Você não pode selecionar mais de 25 tópicos
			Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
		
		
		
		
		
			
	
	
		
			
				
					
						
						
							|  | stories = [];
function initGame(story, state) {
  state.info = {};
  state.info.time = 60 * 60 * 9;
  state.player.stats = {};
  state.player.stats.health = 100;
}
// TODO: format string this lol
function renderTime(time) {
  let hours = Math.floor(time / 3600) % 12;
  const ampm = Math.floor(time / 3600) % 24 < 12 ? "AM" : "PM";
  let minutes = Math.floor(time / 60) % 60;
  let seconds = time % 60;
  if (minutes <= 9)
    minutes = "0" + minutes;
  if (seconds <= 9)
    seconds = "0" + seconds;
  return hours + ":" + minutes + ":" + seconds + " " + ampm;
}
function updateWorldInfo(state) {
  const timeInfo = document.querySelector("#world-info-time");
  timeInfo.textContent = "Time: " + renderTime(state.info.time);
}
function updatePlayerInfo(state) {
  const health = document.querySelector("#player-info-health");
  health.textContent = "Health: " + state.player.stats.health;
}
 |