textlog overlap
This commit is contained in:
11
js/game.js
11
js/game.js
@@ -172,14 +172,18 @@ const game = {
|
||||
}
|
||||
document.getElementById("mods").innerHTML = text
|
||||
},
|
||||
replaceTextLog: true,
|
||||
makeTextLog(text, time = 180) {
|
||||
document.getElementById("text-log").innerHTML = text;
|
||||
document.getElementById("text-log").style.opacity = 1;
|
||||
game.lastLogTime = mech.cycle + time;
|
||||
if (game.replaceTextLog) {
|
||||
document.getElementById("text-log").innerHTML = text;
|
||||
document.getElementById("text-log").style.opacity = 1;
|
||||
game.lastLogTime = mech.cycle + time;
|
||||
}
|
||||
},
|
||||
textLog() {
|
||||
if (game.lastLogTime && game.lastLogTime < mech.cycle) {
|
||||
game.lastLogTime = 0;
|
||||
game.replaceTextLog = true
|
||||
// document.getElementById("text-log").innerHTML = " ";
|
||||
document.getElementById("text-log").style.opacity = 0;
|
||||
}
|
||||
@@ -269,6 +273,7 @@ const game = {
|
||||
requestAnimationFrame(cycle);
|
||||
} else {
|
||||
game.paused = true;
|
||||
game.replaceTextLog = true;
|
||||
game.makeTextLog("<h1>PAUSED</h1>", 1);
|
||||
// let text = "<h1>PAUSED</h1><br><div style='font-size: 85%;'>"
|
||||
// //output current mod, field, and gun info when paused
|
||||
|
||||
Reference in New Issue
Block a user