Skip to content

Commit

Permalink
v0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jwklong committed Jan 4, 2022
1 parent 1832653 commit 65bd6be
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 22 deletions.
4 changes: 2 additions & 2 deletions js/classes/prestigelayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,10 @@ class PrestigeLayer
createUpgradeTree()
{
this.treeUpgrades = [];
const upgs = []; //this is still undefined, so local var is used
var upgs = []; //this is still undefined, so local var is used
const rand = new Random(this.layer);
const rows = 5 + rand.nextInt(2);
let amnt = 2;
let amnt = 1;
let amntBefore = 1;

const requiredUpgrade = function(row, col)
Expand Down
6 changes: 6 additions & 0 deletions js/components/changelog-tab.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Vue.component("changelog-tab", {
template: `<div class="changelog-tab">
<guide-item>
<template v-slot:title>v0.1.1</template>
<template v-slot:text>Fixes a few bugs and adds save management, now you can have more then 1 save stored!
</template>
</guide-item>
<guide-item>
<template v-slot:title>v0.1.0</template>
<template v-slot:text>First public build, with layer names, fonts, the changelog and so much more!
</template>
Expand All @@ -19,5 +24,6 @@ Vue.component("changelog-tab", {
<template v-slot:title>v0.0.1</template>
<template v-slot:text>Private Build
</template>
</guide-item>
</div>`
})
7 changes: 6 additions & 1 deletion js/components/settings-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Vue.component("settings-menu", {
" Click Import to load the save string from the text field.",
themes: mod.themes,
names: mod.layerNames,
fonts: mod.fonts
fonts: mod.fonts,
saves: mod.saves
}
},
mounted: function()
Expand Down Expand Up @@ -96,6 +97,7 @@ Vue.component("settings-menu", {
setTheme: css => functions.setTheme(css),
setNames: js => functions.setNames(js),
setFont: css => functions.setFont(css),
setSave: info => functions.setSave(info),
volatilityUnlocked: () => functions.maxLayerUnlocked() >= 2
},
template: `<div class="settings">
Expand Down Expand Up @@ -149,6 +151,9 @@ Vue.component("settings-menu", {
<button @click="importGame()">Import</button>
<button @click="hardResetGame()">Wipe Game</button>
</div>
<div class="settings-row">
<button :class="{selected: settings.saveInfo === t[1]}" v-for="t in saves" @click="setSave(t[1])">{{t[0]}}</button>
</div>
<div class="settings-row">
<textarea ref="exportBox" class="export" v-model="exportString"></textarea>
</div>
Expand Down
35 changes: 23 additions & 12 deletions js/data/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const functions = {
}
if(n.mag === Infinity)
{
return "very much too big";
return "Infinite";
}
if(n.lt(0))
{
Expand Down Expand Up @@ -106,9 +106,16 @@ const functions = {
game.settings.layerNames = stuff;
[LETTERS, ORDERS, GIANTS] = stuff;
},
setSave: function(info)
{
this.saveGame()
game.settings.saveInfo = info
this.hardResetGame(true)
this.loadGame()
},
createNotification: function(notification)
{
if (saveTimer > 1){game.notifications.push(notification)};
if (localTimer > 1){game.notifications.push(notification)};
},
getSaveString()
{
Expand Down Expand Up @@ -174,8 +181,9 @@ const functions = {
game.timeSaved = Date.now();
try
{
localStorage.setItem(mod.primaryName+mod.secondaryName, this.getSaveString());
localStorage.setItem(mod.primaryName+mod.secondaryName+"_Settings", this.getSettingsSaveString());
localStorage.setItem(mod.primaryName+mod.secondaryName+game.settings.saveInfo, this.getSaveString());
localStorage.setItem(mod.primaryName+mod.secondaryName+"_Settings"+game.settings.saveInfo, this.getSettingsSaveString());
localStorage.setItem(mod.primaryName+mod.secondaryName+"_SaveInfo", game.settings.saveInfo);
if(game.settings.notifications && game.settings.saveNotifications)
{
functions.createNotification(new Notification(NOTIFICATION_STANDARD, "Game Saved!", "images/save.svg"));
Expand All @@ -193,7 +201,8 @@ const functions = {
{
let loadObj;
const isImported = typeof(str) !== "undefined";
str = str || localStorage.getItem(mod.primaryName+mod.secondaryName) || null;
game.settings.saveInfo = game.settings.saveInfo === "i have no idea" ? localStorage.getItem(mod.primaryName+mod.secondaryName+"_SaveInfo") || "" : game.settings.saveInfo
str = str || localStorage.getItem(mod.primaryName+mod.secondaryName+game.settings.saveInfo) || null;
if(str === null) return;
if(str === "?")
{
Expand Down Expand Up @@ -294,12 +303,13 @@ const functions = {
{
try
{
const settings = JSON.parse(decodeURIComponent(escape(atob(localStorage.getItem(mod.primaryName+mod.secondaryName+"_Settings")))));
const settings = JSON.parse(decodeURIComponent(escape(atob(localStorage.getItem(mod.primaryName+mod.secondaryName+"_Settings"+game.settings.saveInfo)))));
settings.saveInfo = game.settings.saveInfo
game.settings = Object.assign(game.settings, settings);
}
catch(e)
{
console.warn("oopsie your settings are sus\n", e.stack);
console.warn("Error setting settings\n", e.stack);
}
}
this.setTheme(game.settings.theme)
Expand All @@ -308,7 +318,7 @@ const functions = {

if(game.version !== loadObj.version)
{
if(loadObj.version === "1")
if(loadObj.version === "1.0" || loadObj.version === "1")
{
for(const l of game.layers)
{
Expand All @@ -330,11 +340,12 @@ const functions = {
functions.createNotification(new Notification(NOTIFICATION_STANDARD, "You were offline for " + functions.formatTime(t)));
}
}

localTimer = 0
return true;
},
hardResetGame: function()
hardResetGame: function(changeSave)
{
if (changeSave !== true) {
let confirmations = 0;
do
{
Expand All @@ -345,8 +356,8 @@ const functions = {
}
confirmations++;
} while(confirmations < 3)

localStorage.setItem(mod.primaryName+mod.secondaryName, null);
localStorage.setItem(mod.primaryName+mod.secondaryName+game.settings.saveInfo, null);
}
game.currentLayer = null;
game.layers = [];
functions.generateLayer(0);
Expand Down
14 changes: 9 additions & 5 deletions js/data/game.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const game = {
version: "1.0",
version: "1.1",
timeSaved: Date.now(),
layers: [],
highestLayer: 0,
Expand Down Expand Up @@ -79,7 +79,10 @@ const game = {
}),
},
achievements: [
new Achievement("Coming soon", "in a later update", mod.primaryName, () => true),
new Achievement("You played!", "If you dont have this, you shouldn't exist", "&omega;", () => true),
new Achievement("Stacking up", "Do a restack and restart your progress", "&kappa;", () => game.restackLayer.timesReset > 0),
new Achievement("No turning back", "Go meta and be reborn", "&Omega;", () => game.metaLayer.active),
new Achievement("Endgame", "Reach layer 1.8e308 and finish "+mod.primaryName+mod.secondaryName, "Ʊ", () => game.metaLayer.layer.gte(Infinities[0])),
],
alephLayer: new AlephLayer(),
restackLayer: new ReStackLayer(),
Expand Down Expand Up @@ -107,9 +110,10 @@ const game = {
confirmations: true,
offlineProgress: true,
titleStyle: 2,
theme: "css/themes/dark.css",
layerNames: ["αβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ", "ψϝϛͱϻϙͳϸ", ["<span class='flipped-v'>Ω</span>", "<span class='flipped-v'>Ω</span><sup>2</sup>","<span class='flipped-v'>Ω</span><sup>3</sup>"]],
font: "css/fonts/typespace.css"
theme: mod.themes[0][1],
layerNames: mod.layerNames[0][1],
font: mod.fonts[0][1],
saveInfo: "i have no idea"
},
};
const initialGame = functions.getSaveString();
1 change: 1 addition & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function tickGame(seconds)
{
game.timeSpent += seconds;
saveTimer += seconds;
localTimer += seconds;

let titleInfo = "";
switch(game.settings.titleStyle)
Expand Down
9 changes: 7 additions & 2 deletions js/mod.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var mod = {
primaryName: "ω",
secondaryName: "Engine",
version: "0.1.0 P2",
engineVer: "0.1.0 P2", //DO NOT MODIFY
version: "0.1.1",
engineVer: "0.1.1", //DO NOT MODIFY
themes: [
["Dark", "css/themes/dark.css"],
["Light", "https://veprogames.github.io/omega-layers/css/main.css"],
Expand Down Expand Up @@ -42,6 +42,11 @@ var mod = {
["Comic Sans", "css/fonts/comic.css"],
["Arial", "css/fonts/arial.css"],
["Roboto", "css/fonts/roboto.css"]
],
saves: [
["Save 1", ""],
["Save 2", "2"],
["Save 3", "3"]
]
}

Expand Down

0 comments on commit 65bd6be

Please sign in to comment.