scratch-vm/src/sprites/sprite.js

18 lines
457 B
JavaScript
Raw Normal View History

var Clone = require('./clone');
var Blocks = require('../engine/blocks');
function Sprite (blocks) {
// Sprites have: shared blocks, shared costumes, shared variables, etc.
if (!blocks) {
// Shared set of blocks for all clones.
blocks = new Blocks();
}
this.blocks = blocks;
this.clones = [];
// Initial single clone with the shared blocks.
this.clones.push(new Clone(this.blocks));
}
module.exports = Sprite;