Skip to content

Commit

Permalink
matter working!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
hspencer committed Jul 16, 2020
1 parent 20c8ee0 commit 33acf47
Show file tree
Hide file tree
Showing 9 changed files with 10,322 additions and 91 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
33 changes: 33 additions & 0 deletions boundary.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/uITcoKpbQq4

function Boundary(x, y, w, h, a) {
var options = {
friction: 0,
restitution: 0.95,
angle: a,
isStatic: true
};
this.body = Bodies.rectangle(x, y, w, h, options);
this.w = w;
this.h = h;
World.add(world, this.body);
console.log(this.body);

this.show = function() {
var pos = this.body.position;
var angle = this.body.angle;
push();
translate(pos.x, pos.y);
rotate(angle);
rectMode(CENTER);
strokeWeight(1);
noStroke();
fill(0);
rect(0, 0, this.w, this.h);
pop();
};
}

1 change: 0 additions & 1 deletion data.json

This file was deleted.

12 changes: 9 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
<!DOCTYPE html><html lang="en"><head>
<script src="p5.js"></script>
<script src="p5.sound.min.js"></script>
<title>acto del momento simultáneo</title>
<script language="javascript" type="text/javascript" src="libraries/p5.js"></script>
<script language="javascript" type="text/javascript" src="libraries/matter.js"></script>

<script src="boundary.js"></script>
<script src="note.js"></script>
<script src="sketch.js"></script>

<link rel="stylesheet" type="text/css" href="style.css">
<meta charset="utf-8">

</head>
<body>
<script src="sketch.js"></script>



<div id="p5"></div>
Expand Down
Loading

0 comments on commit 33acf47

Please sign in to comment.