This commit is contained in:
John Alanbrook 2023-06-09 03:50:52 +00:00
parent 09b1d46986
commit a4b85df08f
2 changed files with 11 additions and 7 deletions

View file

@ -2186,9 +2186,14 @@ gameobject.clone("sprite", {
sprite: sprite.clone(),
});
if (IO.exists("config.js"))
load("config.js");
var prototypes = JSON.parse(slurp("proto.json"));
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]);

View file

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