From a4b85df08fbe75189eb5d38fa0b17432caa429d7 Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Fri, 9 Jun 2023 03:50:52 +0000 Subject: [PATCH] break --- source/scripts/engine.js | 9 +++++++-- source/scripts/play.js | 9 ++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/source/scripts/engine.js b/source/scripts/engine.js index f8b8832..674e52f 100644 --- a/source/scripts/engine.js +++ b/source/scripts/engine.js @@ -2186,9 +2186,14 @@ gameobject.clone("sprite", { sprite: sprite.clone(), }); -load("config.js"); -var prototypes = JSON.parse(slurp("proto.json")); +if (IO.exists("config.js")) + load("config.js"); + +var prototypes = {}; +if (IO.exists("proto.json")) + prototypes = JSON.parse(slurp("proto.json")); + for (var key in prototypes) { if (key in gameobjects) dainty_assign(gameobjects[key], prototypes[key]); diff --git a/source/scripts/play.js b/source/scripts/play.js index c075110..821ea12 100644 --- a/source/scripts/play.js +++ b/source/scripts/play.js @@ -1,7 +1,6 @@ -if (load("game.js") === false) { - Log.error("No game.js. No game."); - quit(); -} - sim_start(); +if (!IO.exists("game.js")) + load("scripts/nogame.js"); +else + load("game.js");