From fe829184b3daa861b1a22ae8a468b3e369ce16c4 Mon Sep 17 00:00:00 2001 From: James Stanley Date: Wed, 1 May 2024 20:50:46 +0100 Subject: [PATCH] Example renderer: refer to this.world instead of global world --- docs/pages/rendering.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/pages/rendering.md b/docs/pages/rendering.md index 3866c78f..faef1148 100644 --- a/docs/pages/rendering.md +++ b/docs/pages/rendering.md @@ -55,7 +55,7 @@ class Renderer { this.world.step(1 / 60); // Iterate over bodies - for (let body = world.getBodyList(); body; body = body.getNext()) { + for (let body = this.world.getBodyList(); body; body = body.getNext()) { this.renderBody(body); // ... and fixtures for (let fixture = body.getFixtureList(); fixture; fixture = fixture.getNext()) { @@ -64,7 +64,7 @@ class Renderer { } // Iterate over joints - for (let joint = world.getJointList(); joint; joint = joint.getNext()) { + for (let joint = this.world.getJointList(); joint; joint = joint.getNext()) { this.renderJoint(joint); }