mirror of
https://github.com/liabru/matter-js.git
synced 2025-01-12 16:08:50 -05:00
demo tweaks
This commit is contained in:
parent
c969767a6d
commit
22445c7717
3 changed files with 11 additions and 4 deletions
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
// options
|
// options
|
||||||
"laxbreak" : true, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
|
"laxbreak" : true, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
|
||||||
|
"loopfunc" : true, // Allow functions in loops (e.g. for async closures)
|
||||||
|
|
||||||
// style
|
// style
|
||||||
"newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`.
|
"newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`.
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
<!-- only required if using MatterTools -->
|
<!-- only required if using MatterTools -->
|
||||||
<link rel="stylesheet" href="./js/lib/matter-tools/matter-tools.css" type="text/css">
|
<link rel="stylesheet" href="./js/lib/matter-tools/matter-tools.css" type="text/css">
|
||||||
<script type="text/javascript" src="./js/lib/matter-tools/jquery-1.11.0.min.js"></script>
|
<script type="text/javascript" src="./js/lib/matter-tools/jquery-1.11.0.min.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/lib/matter-tools/gif/gif.js"></script>
|
||||||
<script type="text/javascript" src="./js/lib/matter-tools/matter-tools-dev.js"></script>
|
<script type="text/javascript" src="./js/lib/matter-tools/matter-tools-dev.js"></script>
|
||||||
|
|
||||||
<!-- matter demo code -->
|
<!-- matter demo code -->
|
||||||
|
@ -34,8 +35,9 @@
|
||||||
<select id="demo-select">
|
<select id="demo-select">
|
||||||
<option value="mixed">Mixed Shapes</option>
|
<option value="mixed">Mixed Shapes</option>
|
||||||
<option value="mixedSolid">Solid Rendering</option>
|
<option value="mixedSolid">Solid Rendering</option>
|
||||||
<option value="concave">Concave Bodies</option>
|
|
||||||
<option value="svg">Concave SVG Paths</option>
|
<option value="svg">Concave SVG Paths</option>
|
||||||
|
<option value="terrain">Concave Terrain</option>
|
||||||
|
<option value="concave">Concave Bodies</option>
|
||||||
<option value="compound">Compound Bodies</option>
|
<option value="compound">Compound Bodies</option>
|
||||||
<option value="newtonsCradle">Newton's Cradle</option>
|
<option value="newtonsCradle">Newton's Cradle</option>
|
||||||
<option value="wreckingBall">Wrecking Ball</option>
|
<option value="wreckingBall">Wrecking Ball</option>
|
||||||
|
|
|
@ -1129,7 +1129,11 @@
|
||||||
|
|
||||||
Demo.reset();
|
Demo.reset();
|
||||||
|
|
||||||
var particleOptions = { render: { visible: true } };
|
var particleOptions = {
|
||||||
|
friction: 0.05,
|
||||||
|
frictionStatic: 0.1,
|
||||||
|
render: { visible: true }
|
||||||
|
};
|
||||||
|
|
||||||
World.add(_world, [
|
World.add(_world, [
|
||||||
Composites.softBody(250, 100, 5, 5, 0, 0, true, 18, particleOptions),
|
Composites.softBody(250, 100, 5, 5, 0, 0, true, 18, particleOptions),
|
||||||
|
@ -1422,8 +1426,8 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var vertices = Vertices.fromPath('164 171,232 233,213 302,273 241,342 305,316 231,364 170,309 188,281 117,240 182'),
|
var star = Vertices.fromPath('50 0 63 38 100 38 69 59 82 100 50 75 18 100 31 59 0 38 37 38'),
|
||||||
concave = Bodies.fromVertices(200, 200, vertices);
|
concave = Bodies.fromVertices(200, 200, star);
|
||||||
|
|
||||||
World.add(_world, [stack, concave]);
|
World.add(_world, [stack, concave]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue