mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Update index.js
This commit is contained in:
parent
f2a08b466d
commit
05a827c0ea
1 changed files with 7 additions and 0 deletions
|
@ -170,9 +170,16 @@ VirtualMachine.prototype.fromJSON = function (json) {
|
|||
var i = 0;
|
||||
for (; i < obj.sprites.length; i++) {
|
||||
var blocks = new Blocks();
|
||||
var z = null;
|
||||
for (z in obj.sprites[i].sprite.blocks) {
|
||||
blocks[z] = obj.sprites[i].sprite.blocks[z];
|
||||
}
|
||||
var sprite = new Sprite(blocks, this.runtime);
|
||||
var y = null;
|
||||
for (y in obj.sprites[i].sprite) {
|
||||
if (y === 'blocks') {
|
||||
continue;
|
||||
}
|
||||
sprite[y] = obj.sprites[i].sprite[y];
|
||||
}
|
||||
var target = sprite.createClone();
|
||||
|
|
Loading…
Reference in a new issue