We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d258411 commit 6dd5ec5Copy full SHA for 6dd5ec5
19 files changed
demo/index.html
@@ -61,6 +61,10 @@
61
opacity: 0.5;
62
background: transparent !important;
63
}
64
+
65
+ .matter-demo canvas {
66
+ border: 1px solid rgba(255, 255, 255, 0.07);
67
+ }
68
</style>
69
</head>
70
<body>
examples/avalanche.js
@@ -41,13 +41,13 @@ Example.avalanche = function() {
41
var stack = Composites.stack(20, 20, 20, 5, 0, 0, function(x, y) {
42
return Bodies.circle(x, y, Common.random(10, 20), { friction: 0.00001, restitution: 0.5, density: 0.001 });
43
});
44
-
45
World.add(world, stack);
46
47
World.add(world, [
48
- Bodies.rectangle(200, 150, 700, 20, { isStatic: true, angle: Math.PI * 0.06 }),
49
- Bodies.rectangle(500, 350, 700, 20, { isStatic: true, angle: -Math.PI * 0.06 }),
50
- Bodies.rectangle(340, 580, 700, 20, { isStatic: true, angle: Math.PI * 0.04 })
+ Bodies.rectangle(200, 150, 700, 20, { isStatic: true, angle: Math.PI * 0.06, render: { fillStyle: '#060a19' } }),
+ Bodies.rectangle(500, 350, 700, 20, { isStatic: true, angle: -Math.PI * 0.06, render: { fillStyle: '#060a19' } }),
+ Bodies.rectangle(340, 580, 700, 20, { isStatic: true, angle: Math.PI * 0.04, render: { fillStyle: '#060a19' } })
51
]);
52
53
// add mouse control
examples/ballPool.js
@@ -39,7 +39,7 @@ Example.ballPool = function() {
39
40
// add bodies
- Bodies.rectangle(400, 600, 1200, 50.5, { isStatic: true })
+ Bodies.rectangle(400, 600, 1200, 50.5, { isStatic: true, render: { fillStyle: '#060a19' } })
var stack = Composites.stack(100, 0, 10, 8, 10, 10, function(x, y) {
examples/bridge.js
@@ -44,7 +44,7 @@ Example.bridge = function() {
density: 0.005,
frictionAir: 0.05,
render: {
- fillStyle: '#575375'
+ fillStyle: '#060a19'
examples/car.js
@@ -48,9 +48,9 @@ Example.car = function() {
World.add(world, Composites.car(350, 300, 150 * scale, 30 * scale, 30 * scale));
- Bodies.rectangle(200, 150, 400, 20, { isStatic: true, angle: Math.PI * 0.06 }),
- Bodies.rectangle(500, 350, 650, 20, { isStatic: true, angle: -Math.PI * 0.06 }),
- Bodies.rectangle(300, 560, 600, 20, { isStatic: true, angle: Math.PI * 0.04 })
+ Bodies.rectangle(200, 150, 400, 20, { isStatic: true, angle: Math.PI * 0.06, render: { fillStyle: '#060a19' }}),
+ Bodies.rectangle(500, 350, 650, 20, { isStatic: true, angle: -Math.PI * 0.06, render: { fillStyle: '#060a19' }}),
+ Bodies.rectangle(300, 560, 600, 20, { isStatic: true, angle: Math.PI * 0.04, render: { fillStyle: '#060a19' }})
54
55
56
examples/catapult.js
@@ -48,9 +48,9 @@ Example.catapult = function() {
stack,
catapult,
- Bodies.rectangle(400, 600, 800, 50.5, { isStatic: true }),
- Bodies.rectangle(250, 555, 20, 50, { isStatic: true }),
- Bodies.rectangle(400, 535, 20, 80, { isStatic: true, collisionFilter: { group: group } }),
+ Bodies.rectangle(400, 600, 800, 50.5, { isStatic: true, render: { fillStyle: '#060a19' } }),
+ Bodies.rectangle(250, 555, 20, 50, { isStatic: true, render: { fillStyle: '#060a19' } }),
+ Bodies.rectangle(400, 535, 20, 80, { isStatic: true, collisionFilter: { group: group }, render: { fillStyle: '#060a19' } }),
Bodies.circle(560, 100, 50, { density: 0.005 }),
Constraint.create({
bodyA: catapult,
examples/cloth.js
@@ -43,8 +43,8 @@ Example.cloth = function() {
cloth,
- Bodies.circle(300, 500, 80, { isStatic: true }),
- Bodies.rectangle(500, 480, 80, 80, { isStatic: true }),
+ Bodies.circle(300, 500, 80, { isStatic: true, render: { fillStyle: '#060a19' }}),
+ Bodies.rectangle(500, 480, 80, 80, { isStatic: true, render: { fillStyle: '#060a19' }}),
Bodies.rectangle(400, 609, 800, 50, { isStatic: true })
examples/collisionFiltering.js
@@ -23,8 +23,7 @@ Example.collisionFiltering = function() {
23
options: {
24
width: 800,
25
height: 600,
26
- wireframes: false,
27
- background: '#111'
+ wireframes: false
28
29
30
@@ -40,9 +39,9 @@ Example.collisionFiltering = function() {
greenCategory = 0x0004,
blueCategory = 0x0008;
- var redColor = '#C44D58',
- blueColor = '#4ECDC4',
- greenColor = '#C7F464';
+ var colorA = '#f55a3c',
+ colorB = '#063e7b',
+ colorC = '#f5d259';
// add floor
World.add(world, Bodies.rectangle(400, 600, 900, 50, {
@@ -57,14 +56,14 @@ Example.collisionFiltering = function() {
57
World.add(world,
58
Composites.stack(275, 100, 5, 9, 10, 10, function(x, y, column, row) {
59
var category = redCategory,
60
- color = redColor;
+ color = colorA;
if (row > 5) {
category = blueCategory;
- color = blueColor;
+ color = colorB;
} else if (row > 2) {
category = greenCategory;
- color = greenColor;
+ color = colorC;
return Bodies.circle(x, y, 20, {
@@ -87,7 +86,7 @@ Example.collisionFiltering = function() {
87
86
mask: defaultCategory | greenCategory
88
},
89
90
- fillStyle: greenColor
+ fillStyle: colorC
91
92
})
93
);
@@ -99,7 +98,7 @@ Example.collisionFiltering = function() {
99
98
mask: defaultCategory | redCategory
100
101
102
- fillStyle: redColor
+ fillStyle: colorA
103
104
105
@@ -111,7 +110,7 @@ Example.collisionFiltering = function() {
111
110
mask: defaultCategory | blueCategory
112
113
114
- fillStyle: blueColor
+ fillStyle: colorB
115
116
117
examples/concave.js
@@ -47,7 +47,7 @@ Example.concave = function() {
horseShoe = Vertices.fromPath('35 7 19 17 14 38 14 58 25 79 45 85 65 84 65 66 46 67 34 59 30 44 33 29 45 23 66 23 66 7 53 7');
var stack = Composites.stack(50, 50, 6, 4, 10, 10, function(x, y) {
- var color = Common.choose(['#556270', '#4ECDC4', '#C7F464', '#FF6B6B', '#C44D58']);
+ var color = Common.choose(['#f19648', '#f5d259', '#f55a3c', '#063e7b', '#ececd1']);
return Bodies.fromVertices(x, y, Common.choose([arrow, chevron, star, horseShoe]), {
fillStyle: color,
examples/doublePendulum.js
@@ -26,8 +26,7 @@ Example.doublePendulum = function() {
- background: '#0f0f13'
31
32
33
@@ -54,9 +53,6 @@ Example.doublePendulum = function() {
- pendulum.bodies[0].render.strokeStyle = '#4a485b';
- pendulum.bodies[1].render.strokeStyle = '#4a485b';
world.gravity.scale = 0.002;
Composites.chain(pendulum, 0.45, 0, -0.45, 0, {
0 commit comments