mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
20 lines
566 B
JavaScript
20 lines
566 B
JavaScript
|
window.onload = function() {
|
||
|
// Lots of global variables to make debugging easier
|
||
|
var vm = new window.VirtualMachine();
|
||
|
window.vm = vm;
|
||
|
|
||
|
var toolbox = document.getElementById('toolbox');
|
||
|
var workspace = window.Blockly.inject('blocks', {
|
||
|
toolbox: toolbox,
|
||
|
media: '../node_modules/scratch-blocks/media/'
|
||
|
});
|
||
|
window.workspace = workspace;
|
||
|
|
||
|
// @todo: Also bind to flyout events, block running feedback.
|
||
|
// Block events.
|
||
|
workspace.addChangeListener(vm.blockListener);
|
||
|
|
||
|
// Run threads
|
||
|
vm.runtime.start();
|
||
|
};
|