Skip to content

Commit 6cfb385

Browse files
committed
update docs, use object literal
1 parent 8416d7b commit 6cfb385

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

docs/pages/body.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ shapes and joints do not move.
109109

110110
```js
111111
world.createBody({
112-
position: Vec2(0, 2), // the body's origin position.
112+
position: {x: 0, y: 2}, // the body's origin position.
113113
angle: 0.25 * Math.PI // the body's angle in radians.
114114
})
115115
```

docs/pages/hello-world.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ To create a world we simply create an object from the `World` class, and optiona
1111

1212
```js
1313
let world = new World({
14-
gravity: new Vec2(0.0, -10.0),
14+
gravity: {x: 0, y: -10},
1515
});
1616
```
1717

@@ -30,7 +30,7 @@ With the body properties we specify the type and initial position of the platfor
3030
```js
3131
let platform = world.createBody({
3232
type: "static",
33-
position: new Vec2(0.0, -10.0),
33+
position: {x: 0, y: -10},
3434
angle: Math.PI * 0.1
3535
});
3636
```
@@ -41,7 +41,7 @@ For step 2, we need to create a `Shape` and add it to body as `Fixture`.
4141

4242
```js
4343
platform.createFixture({
44-
shape: new Edge(new Vec2(-50, 0), new Vec2(+50, 0)),
44+
shape: new Edge({x: -50, y: 0}, {x: +50, y: 0}),
4545
});
4646
```
4747

@@ -69,7 +69,7 @@ First we create the body using `createBody`. By default bodies are static, so we
6969
```js
7070
let body = world.createBody({
7171
type: "dynamic",
72-
position: new Vec2(0.0, 4.0)
72+
position: {x: 0, y: 4}
7373
});
7474
```
7575

docs/pages/world.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ vector and a boolean indicating if bodies can sleep.
1010

1111
```js
1212
let myWorld = new World({
13-
gravity: Vec2(0, -10),
13+
gravity: {x: 0, y: -10},
1414
allowSleep: true,
1515
});
1616
```

0 commit comments

Comments
 (0)