Track play time on the title screen

when's 100% attempts
This commit is contained in:
RedEnchilada 2016-05-14 20:29:03 -05:00
parent e90388c2a2
commit c8c7cd25c9
3 changed files with 12 additions and 1 deletions

View file

@ -28,6 +28,7 @@ Game = (function() {
requestAnimationFrame(gameLoop); requestAnimationFrame(gameLoop);
Input.refresh(); Input.refresh();
Memory.global.time++;
flipScenes(); flipScenes();
currentScene.ticCount++; currentScene.ticCount++;

View file

@ -10,6 +10,7 @@ Memory = (function() {
global: { global: {
keys: [], keys: [],
time: 0,
}, },
}; };

View file

@ -117,7 +117,16 @@ Title = function() {
"Save 5": "Closure", "Save 5": "Closure",
}; };
menu[2].text = "Slot: " + Memory.slot + " - " + (file ? list[file.lastStage] : "EMPTY"); var playtime = "0:00";
if (file && file.global.time) {
playtime = Math.floor(file.global.time / 3600) + ":"
+ (Math.floor(file.global.time / 600) % 10) + ""
+ (Math.floor(file.global.time / 60) % 10);
}
menu[2].text = "Slot: " + Memory.slot + " - " + (file ? list[file.lastStage] : "EMPTY")
+ " (" + playtime + ")";
} }
} }