2025-09-29 20:31:42 -07:00
|
|
|
globalThis.desktop_mode = false;
|
2025-07-29 12:50:35 -07:00
|
|
|
|
2025-09-29 20:31:42 -07:00
|
|
|
function load_gamestate() {
|
2025-07-29 12:50:35 -07:00
|
|
|
var gamestate_loaded = window.localStorage.getItem("gamestate");
|
|
|
|
|
|
|
|
if (gamestate_loaded == null) {
|
|
|
|
record_log("Welcome to Seagull Game! We haven't found a save in your browser storage, so we're starting a new game!");
|
|
|
|
gamestate = structuredClone(gamestate_default);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
gamestate = JSON.parse(gamestate_loaded);
|
|
|
|
record_log("Welcome back! Game loaded.")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function save_game() {
|
|
|
|
window.localStorage.setItem("gamestate", JSON.stringify(gamestate));
|
|
|
|
record_log("Game saved.");
|
|
|
|
}
|
|
|
|
|
|
|
|
var tick_meter_running = true;
|
|
|
|
|
|
|
|
function reset_game() {
|
|
|
|
tick_meter_running = false;
|
|
|
|
window.localStorage.removeItem("gamestate");
|
|
|
|
window.location.reload();
|
|
|
|
}
|