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");