mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-23 08:51:48 +00:00
Fixed endgame screen
This commit is contained in:
parent
68521fb631
commit
7f24c52a4f
7 changed files with 27 additions and 24 deletions
|
@ -1,5 +1,8 @@
|
||||||
# The Modding Tree changelog:
|
# The Modding Tree changelog:
|
||||||
|
|
||||||
|
# v2.6.4.1 - 6/17/21
|
||||||
|
- Fixed a bug with the endgame screen.
|
||||||
|
|
||||||
# v2.6.4 - 6/17/21
|
# v2.6.4 - 6/17/21
|
||||||
- The game now autosaves before closing, if autosave is on. (Thank you to thepaperpilot for this!)
|
- The game now autosaves before closing, if autosave is on. (Thank you to thepaperpilot for this!)
|
||||||
- More Anti-NaN safety.
|
- More Anti-NaN safety.
|
||||||
|
|
14
demo.html
14
demo.html
|
@ -41,13 +41,13 @@
|
||||||
|
|
||||||
<body onload="load()" onmousemove="updateMouse(event)">
|
<body onload="load()" onmousemove="updateMouse(event)">
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<canvas id="treeCanvas" class="canvas" v-if="!(gameEnded && !player.keepGoing)"></canvas>
|
<canvas id="treeCanvas" class="canvas" v-if="!(tmp.gameEnded && !player.keepGoing)"></canvas>
|
||||||
|
|
||||||
<div v-if="false" id="loadingSection" class="fullWidth">
|
<div v-if="false" id="loadingSection" class="fullWidth">
|
||||||
<h1>Loading... (If this takes too long it means there was a serious error!)←</h1>
|
<h1>Loading... (If this takes too long it means there was a serious error!)←</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="vl" v-if="player.navTab !== 'none' && tmp.other.splitScreen && player.tab!='none' && !(gameEnded && !player.keepGoing)"></div>
|
<div class="vl" v-if="player.navTab !== 'none' && tmp.other.splitScreen && player.tab!='none' && !(tmp.gameEnded && !player.keepGoing)"></div>
|
||||||
<div v-if="(gameEnded && !player.keepGoing)" class="fullWidth">
|
<div v-if="(tmp.gameEnded && !player.keepGoing)" class="fullWidth">
|
||||||
<br>
|
<br>
|
||||||
<h2>{{modInfo.name}} {{VERSION.withoutName}}</h2><br><br>
|
<h2>{{modInfo.name}} {{VERSION.withoutName}}</h2><br><br>
|
||||||
<h3 v-html="modInfo.winText"></h3><br>
|
<h3 v-html="modInfo.winText"></h3><br>
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
<br><br>
|
<br><br>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="treeOverlay" v-if="!(gameEnded && !player.keepGoing) && (player.tab === 'none' || tmp.other.splitScreen || !readData(layoutInfo.showTree))" class="treeOverlay" onscroll="resizeCanvas()"
|
<div id="treeOverlay" v-if="!(tmp.gameEnded && !player.keepGoing) && (player.tab === 'none' || tmp.other.splitScreen || !readData(layoutInfo.showTree))" class="treeOverlay" onscroll="resizeCanvas()"
|
||||||
v-bind:class="{
|
v-bind:class="{
|
||||||
fullWidth: (player.tab == 'none' || player.navTab == 'none'),
|
fullWidth: (player.tab == 'none' || player.navTab == 'none'),
|
||||||
col: (player.tab !== 'none' && player.navTab !== 'none'),
|
col: (player.tab !== 'none' && player.navTab !== 'none'),
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
v-bind:style="{'font-size': '16px'}">Main Prestige Tree server</a></li>
|
v-bind:style="{'font-size': '16px'}">Main Prestige Tree server</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<overlay-head v-if="!(gameEnded && !player.keepGoing)"></overlay-head>
|
<overlay-head v-if="!(tmp.gameEnded && !player.keepGoing)"></overlay-head>
|
||||||
<div class="sideLayers">
|
<div class="sideLayers">
|
||||||
<div v-for="(node, index) in OTHER_LAYERS['side']">
|
<div v-for="(node, index) in OTHER_LAYERS['side']">
|
||||||
<tree-node :layer='node' :abb='tmp[node].symbol' :size="'small'" :key="'side' + index"></tree-node>
|
<tree-node :layer='node' :abb='tmp[node].symbol' :size="'small'" :key="'side' + index"></tree-node>
|
||||||
|
@ -100,7 +100,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="!(gameEnded && !player.keepGoing) && (player.tab === 'none' || tmp.other.splitScreen)" id="treeTab" onscroll="resizeCanvas()"
|
<div v-if="!(tmp.gameEnded && !player.keepGoing) && (player.tab === 'none' || tmp.other.splitScreen)" id="treeTab" onscroll="resizeCanvas()"
|
||||||
v-bind:class="{ fullWidth: (player.tab == 'none' || player.navTab == 'none'), col: (player.tab !== 'none' && player.navTab !== 'none'), left: (player.tab !== 'none' && player.navTab !== 'none')}">
|
v-bind:class="{ fullWidth: (player.tab == 'none' || player.navTab == 'none'), col: (player.tab !== 'none' && player.navTab !== 'none'), left: (player.tab !== 'none' && player.navTab !== 'none')}">
|
||||||
<br><br><br><br>
|
<br><br><br><br>
|
||||||
<overlay-head id="fakeHead" style="visibility: hidden;">
|
<overlay-head id="fakeHead" style="visibility: hidden;">
|
||||||
|
@ -125,7 +125,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="player.navTab !== 'none' && player.tab !== 'none' && !(gameEnded && !player.keepGoing)" onscroll="resizeCanvas()" v-bind:class="{ fullWidth: player.navTab == 'none' || !tmp.other.splitScreen || !readData(layoutInfo.showTree), col: player.navTab != 'none', right: player.navTab != 'none', fast: true, tab: true}">
|
<div v-if="player.navTab !== 'none' && player.tab !== 'none' && !(tmp.gameEnded && !player.keepGoing)" onscroll="resizeCanvas()" v-bind:class="{ fullWidth: player.navTab == 'none' || !tmp.other.splitScreen || !readData(layoutInfo.showTree), col: player.navTab != 'none', right: player.navTab != 'none', fast: true, tab: true}">
|
||||||
<div v-for="layer in LAYERS">
|
<div v-for="layer in LAYERS">
|
||||||
<div v-if="player.tab==layer">
|
<div v-if="player.tab==layer">
|
||||||
<layer-tab :layer="layer" :back="'none'" :spacing="'50px'" :key="'left'"></layer-tab>
|
<layer-tab :layer="layer" :back="'none'" :spacing="'50px'" :key="'left'"></layer-tab>
|
||||||
|
|
14
index.html
14
index.html
|
@ -40,13 +40,13 @@
|
||||||
|
|
||||||
<body onload="load()" onmousemove="updateMouse(event)">
|
<body onload="load()" onmousemove="updateMouse(event)">
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<canvas id="treeCanvas" class="canvas" v-if="!(gameEnded && !player.keepGoing)"></canvas>
|
<canvas id="treeCanvas" class="canvas" v-if="!(tmp.gameEnded && !player.keepGoing)"></canvas>
|
||||||
|
|
||||||
<div v-if="false" id="loadingSection" class="fullWidth">
|
<div v-if="false" id="loadingSection" class="fullWidth">
|
||||||
<h1>Loading... (If this takes too long it means there was a serious error!)←</h1>
|
<h1>Loading... (If this takes too long it means there was a serious error!)←</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="vl" v-if="player.navTab !== 'none' && tmp.other.splitScreen && player.tab!='none' && !(gameEnded && !player.keepGoing)"></div>
|
<div class="vl" v-if="player.navTab !== 'none' && tmp.other.splitScreen && player.tab!='none' && !(tmp.gameEnded && !player.keepGoing)"></div>
|
||||||
<div v-if="(gameEnded && !player.keepGoing)" class="fullWidth">
|
<div v-if="(tmp.gameEnded && !player.keepGoing)" class="fullWidth">
|
||||||
<br>
|
<br>
|
||||||
<h2>{{modInfo.name}} {{VERSION.withoutName}}</h2><br><br>
|
<h2>{{modInfo.name}} {{VERSION.withoutName}}</h2><br><br>
|
||||||
<h3 v-html="modInfo.winText"></h3><br>
|
<h3 v-html="modInfo.winText"></h3><br>
|
||||||
|
@ -65,7 +65,7 @@
|
||||||
<br><br>
|
<br><br>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="treeOverlay" v-if="!(gameEnded && !player.keepGoing) && (player.tab === 'none' || tmp.other.splitScreen || !readData(layoutInfo.showTree))" class="treeOverlay" onscroll="resizeCanvas()"
|
<div id="treeOverlay" v-if="!(tmp.gameEnded && !player.keepGoing) && (player.tab === 'none' || tmp.other.splitScreen || !readData(layoutInfo.showTree))" class="treeOverlay" onscroll="resizeCanvas()"
|
||||||
v-bind:class="{
|
v-bind:class="{
|
||||||
fullWidth: (player.tab == 'none' || player.navTab == 'none'),
|
fullWidth: (player.tab == 'none' || player.navTab == 'none'),
|
||||||
col: (player.tab !== 'none' && player.navTab !== 'none'),
|
col: (player.tab !== 'none' && player.navTab !== 'none'),
|
||||||
|
@ -91,7 +91,7 @@
|
||||||
v-bind:style="{'font-size': '16px'}">Main Prestige Tree server</a></li>
|
v-bind:style="{'font-size': '16px'}">Main Prestige Tree server</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<overlay-head v-if="!(gameEnded && !player.keepGoing)"></overlay-head>
|
<overlay-head v-if="!(tmp.gameEnded && !player.keepGoing)"></overlay-head>
|
||||||
<div class="sideLayers">
|
<div class="sideLayers">
|
||||||
<div v-for="(node, index) in OTHER_LAYERS['side']">
|
<div v-for="(node, index) in OTHER_LAYERS['side']">
|
||||||
<tree-node :layer='node' :abb='tmp[node].symbol' :size="'small'" :key="'side' + index"></tree-node>
|
<tree-node :layer='node' :abb='tmp[node].symbol' :size="'small'" :key="'side' + index"></tree-node>
|
||||||
|
@ -99,7 +99,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="!(gameEnded && !player.keepGoing) && (player.tab === 'none' || tmp.other.splitScreen)" id="treeTab" onscroll="resizeCanvas()"
|
<div v-if="!(tmp.gameEnded && !player.keepGoing) && (player.tab === 'none' || tmp.other.splitScreen)" id="treeTab" onscroll="resizeCanvas()"
|
||||||
v-bind:class="{ fullWidth: (player.tab == 'none' || player.navTab == 'none'), col: (player.tab !== 'none' && player.navTab !== 'none'), left: (player.tab !== 'none' && player.navTab !== 'none')}">
|
v-bind:class="{ fullWidth: (player.tab == 'none' || player.navTab == 'none'), col: (player.tab !== 'none' && player.navTab !== 'none'), left: (player.tab !== 'none' && player.navTab !== 'none')}">
|
||||||
<br><br><br><br>
|
<br><br><br><br>
|
||||||
<overlay-head id="fakeHead" style="visibility: hidden;">
|
<overlay-head id="fakeHead" style="visibility: hidden;">
|
||||||
|
@ -124,7 +124,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="player.navTab !== 'none' && player.tab !== 'none' && !(gameEnded && !player.keepGoing)" onscroll="resizeCanvas()" v-bind:class="{ fullWidth: player.navTab == 'none' || !tmp.other.splitScreen || !readData(layoutInfo.showTree), col: player.navTab != 'none', right: player.navTab != 'none', fast: true, tab: true}">
|
<div v-if="player.navTab !== 'none' && player.tab !== 'none' && !(tmp.gameEnded && !player.keepGoing)" onscroll="resizeCanvas()" v-bind:class="{ fullWidth: player.navTab == 'none' || !tmp.other.splitScreen || !readData(layoutInfo.showTree), col: player.navTab != 'none', right: player.navTab != 'none', fast: true, tab: true}">
|
||||||
<div v-for="layer in LAYERS">
|
<div v-for="layer in LAYERS">
|
||||||
<div v-if="player.tab==layer">
|
<div v-if="player.tab==layer">
|
||||||
<layer-tab :layer="layer" :back="'none'" :spacing="'50px'" :key="'left'"></layer-tab>
|
<layer-tab :layer="layer" :back="'none'" :spacing="'50px'" :key="'left'"></layer-tab>
|
||||||
|
|
|
@ -13,7 +13,7 @@ let modInfo = {
|
||||||
|
|
||||||
// Set your version in num and name
|
// Set your version in num and name
|
||||||
let VERSION = {
|
let VERSION = {
|
||||||
num: "2.6.4",
|
num: "2.6.4.1",
|
||||||
name: "Fixed Reality",
|
name: "Fixed Reality",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ var displayThings = [
|
||||||
|
|
||||||
// Determines when the game "ends"
|
// Determines when the game "ends"
|
||||||
function isEndgame() {
|
function isEndgame() {
|
||||||
return player.points.gte(new Decimal("e280000000"))
|
return player.points.gte(new Decimal("11"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
13
js/game.js
13
js/game.js
|
@ -1,10 +1,9 @@
|
||||||
var player;
|
var player;
|
||||||
var needCanvasUpdate = true;
|
var needCanvasUpdate = true;
|
||||||
var gameEnded = false;
|
|
||||||
|
|
||||||
// Don't change this
|
// Don't change this
|
||||||
const TMT_VERSION = {
|
const TMT_VERSION = {
|
||||||
tmtNum: "2.6.4",
|
tmtNum: "2.6.4.1",
|
||||||
tmtName: "Fixed Reality"
|
tmtName: "Fixed Reality"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -312,15 +311,15 @@ function autobuyUpgrades(layer){
|
||||||
}
|
}
|
||||||
|
|
||||||
function gameLoop(diff) {
|
function gameLoop(diff) {
|
||||||
if (isEndgame() || gameEnded){
|
if (isEndgame() || tmp.gameEnded){
|
||||||
gameEnded = 1
|
tmp.gameEnded = true
|
||||||
clearParticles()
|
clearParticles()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNaN(diff) || diff < 0) diff = 0
|
if (isNaN(diff) || diff < 0) diff = 0
|
||||||
if (gameEnded && !player.keepGoing) {
|
if (tmp.gameEnded && !player.keepGoing) {
|
||||||
diff = 0
|
diff = 0
|
||||||
//player.tab = "gameEnded"
|
//player.tab = "tmp.gameEnded"
|
||||||
clearParticles()
|
clearParticles()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,7 +388,7 @@ var ticking = false
|
||||||
var interval = setInterval(function() {
|
var interval = setInterval(function() {
|
||||||
if (player===undefined||tmp===undefined) return;
|
if (player===undefined||tmp===undefined) return;
|
||||||
if (ticking) return;
|
if (ticking) return;
|
||||||
if (gameEnded&&!player.keepGoing) return;
|
if (tmp.gameEnded&&!player.keepGoing) return;
|
||||||
ticking = true
|
ticking = true
|
||||||
let now = Date.now()
|
let now = Date.now()
|
||||||
let diff = (now - player.time) / 1e3
|
let diff = (now - player.time) / 1e3
|
||||||
|
|
|
@ -28,6 +28,7 @@ function setupTemp() {
|
||||||
tmp.backgroundStyle = {}
|
tmp.backgroundStyle = {}
|
||||||
tmp.displayThings = []
|
tmp.displayThings = []
|
||||||
tmp.scrolled = 0
|
tmp.scrolled = 0
|
||||||
|
tmp.gameEnded = false
|
||||||
funcs = {}
|
funcs = {}
|
||||||
|
|
||||||
setupTempData(layers, tmp, funcs)
|
setupTempData(layers, tmp, funcs)
|
||||||
|
|
|
@ -308,7 +308,7 @@ function versionCheck() {
|
||||||
var saveInterval = setInterval(function () {
|
var saveInterval = setInterval(function () {
|
||||||
if (player === undefined)
|
if (player === undefined)
|
||||||
return;
|
return;
|
||||||
if (gameEnded && !player.keepGoing)
|
if (tmp.gameEnded && !player.keepGoing)
|
||||||
return;
|
return;
|
||||||
if (options.autosave)
|
if (options.autosave)
|
||||||
save();
|
save();
|
||||||
|
|
Loading…
Reference in a new issue