mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2025-09-11 02:57:36 +02:00
Tilorswift levels can now be loaded into the running game
This commit is contained in:
13
js/Level.js
13
js/Level.js
@@ -84,4 +84,15 @@ export default class Level
|
||||
|
||||
return level;
|
||||
}
|
||||
}
|
||||
|
||||
static createFromJson(json)
|
||||
{
|
||||
const data = JSON.parse(json);
|
||||
|
||||
const terrain = Terrain.createFromJson(data);
|
||||
const level = new Level(terrain);
|
||||
level.setGravity(data.gravity);
|
||||
|
||||
return level;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user