desktop support

This commit is contained in:
2025-07-29 12:50:35 -07:00
parent b08eab62cc
commit 68ef7c1591
23 changed files with 385 additions and 61 deletions

27
static/js/seagull-web.js Normal file
View File

@@ -0,0 +1,27 @@
var desktop_mode = false;
function prepare_gamestate() {
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();
}