Skip to content

Commit 22445c7

Browse files
committed
demo tweaks
1 parent c969767 commit 22445c7

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

.jshintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
// options
1616
"laxbreak" : true, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
17+
"loopfunc" : true, // Allow functions in loops (e.g. for async closures)
1718

1819
// style
1920
"newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`.

demo/dev.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<!-- only required if using MatterTools -->
1919
<link rel="stylesheet" href="./js/lib/matter-tools/matter-tools.css" type="text/css">
2020
<script type="text/javascript" src="./js/lib/matter-tools/jquery-1.11.0.min.js"></script>
21+
<script type="text/javascript" src="./js/lib/matter-tools/gif/gif.js"></script>
2122
<script type="text/javascript" src="./js/lib/matter-tools/matter-tools-dev.js"></script>
2223

2324
<!-- matter demo code -->
@@ -34,8 +35,9 @@ <h1>Matter.js Demo (Dev. Build)</h1>
3435
<select id="demo-select">
3536
<option value="mixed">Mixed Shapes</option>
3637
<option value="mixedSolid">Solid Rendering</option>
37-
<option value="concave">Concave Bodies</option>
3838
<option value="svg">Concave SVG Paths</option>
39+
<option value="terrain">Concave Terrain</option>
40+
<option value="concave">Concave Bodies</option>
3941
<option value="compound">Compound Bodies</option>
4042
<option value="newtonsCradle">Newton's Cradle</option>
4143
<option value="wreckingBall">Wrecking Ball</option>

demo/js/Demo.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,11 @@
11291129

11301130
Demo.reset();
11311131

1132-
var particleOptions = { render: { visible: true } };
1132+
var particleOptions = {
1133+
friction: 0.05,
1134+
frictionStatic: 0.1,
1135+
render: { visible: true }
1136+
};
11331137

11341138
World.add(_world, [
11351139
Composites.softBody(250, 100, 5, 5, 0, 0, true, 18, particleOptions),
@@ -1422,8 +1426,8 @@
14221426
}
14231427
});
14241428

1425-
var vertices = Vertices.fromPath('164 171,232 233,213 302,273 241,342 305,316 231,364 170,309 188,281 117,240 182'),
1426-
concave = Bodies.fromVertices(200, 200, vertices);
1429+
var star = Vertices.fromPath('50 0 63 38 100 38 69 59 82 100 50 75 18 100 31 59 0 38 37 38'),
1430+
concave = Bodies.fromVertices(200, 200, star);
14271431

14281432
World.add(_world, [stack, concave]);
14291433

0 commit comments

Comments
 (0)