From b5db2b41403479b2bcd49296b1493ca5c7b8c087 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Wed, 17 May 2023 17:42:26 -0600 Subject: [PATCH] refactor variable names (no logic changes) --- src/components/World/World.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/components/World/World.js b/src/components/World/World.js index 9246b7c0..4c7cbd0f 100644 --- a/src/components/World/World.js +++ b/src/components/World/World.js @@ -14,15 +14,12 @@ import { createControls } from "./systems/controls.js"; import { createRenderer } from "./systems/renderer.js"; import { AppString } from "@/constants/app"; -// These variables are module-scoped: we cannot access them -// from outside the module - -const color = "#42b883"; -const color2 = "#0055aa"; -const PLATFORM_SIZE = 100; +const BASE32 = "0123456789ABCDEFGHJKMNPQRSTVWXYZ"; +const COLOR1 = "#42b883"; +const COLOR2 = "#0055aa"; const PLATFORM_BORDER = 10; const PLATFORM_EDGE_FOR_UNKNOWNS = 10; -const BASE32 = "0123456789ABCDEFGHJKMNPQRSTVWXYZ"; +const PLATFORM_SIZE = 100; function createLight() { const light = new SpotLight(0xffffff, 100, 0, Math.PI / 8, 0.5, 0); @@ -37,7 +34,7 @@ class World { // Instances of camera, scene, and renderer this.camera = createCamera(); - this.scene = createScene(color2); + this.scene = createScene(COLOR2); this.renderer = createRenderer(); this.light = null; @@ -52,11 +49,11 @@ class World { const controls = createControls(this.camera, this.renderer.domElement); // Light Instance, with optional light helper - const { light } = createLights(color); + const { light } = createLights(COLOR1); // Terrain Instance const terrain = createTerrain({ - color: color, + color: COLOR1, height: PLATFORM_SIZE + PLATFORM_BORDER, width: PLATFORM_SIZE + PLATFORM_BORDER + PLATFORM_EDGE_FOR_UNKNOWNS, });