matter.js and microStudio JavaScript
I Created JavaScript microStudio project + matter.js then taken example code from https://github.com/liabru/matter-js/wiki/Getting-started paste it to init() function like that:
init = function() {
// module aliases
var Engine = Matter.Engine,
Render = Matter.Render,
Runner = Matter.Runner,
Bodies = Matter.Bodies,
Composite = Matter.Composite;
// create an engine
var engine = Engine.create();
// create a renderer
var render = Render.create({
element: document.body,
engine: engine
});
// create two boxes and a ground
var boxA = Bodies.rectangle(400, 200, 80, 80);
var boxB = Bodies.rectangle(450, 50, 80, 80);
var ground = Bodies.rectangle(400, 610, 810, 60, { isStatic: true });
// add all of the bodies to the world
Composite.add(engine.world, [boxA, boxB, ground]);
// run the renderer
Render.run(render);
// create runner
var runner = Runner.create();
// run the engine
Runner.run(runner, engine);
}
update = function() {
}
draw = function() {
// screen.clear()
// screen.drawSprite("ball",x,y,8,8)
}
and nothing happen, where do I wrong ? How to run example code from matterjs in microStudio ? Thanks