xxxxxxxxxx
45
let Engine = Matter.Engine;
let World = Matter.World;
let Bodies = Matter.Bodies;
let engine;
let world;
let bodies = [];
let rigids = [];
let grounds = [];
let bodieParams;
function setup() {
createCanvas(800, 800);
rectMode(CENTER);
engine = Engine.create();
world = engine.world;
bodieParams = {
restitution: 0.9,
};
let g1 = Bodies.rectangle(width / 2, height - 30, width * 4, 7, {
isStatic: true,
});
grounds.push(g1);
World.add(world, bodies);
World.add(world, grounds);
Matter.Runner.run(engine);
}
function draw() {
background(75);
}
function keyPressed() {
if (keyCode === ENTER) {
save("theEye");
}
}