Compare commits

..

No commits in common. "cae3dc9af577b3db35a4d92961998f2539171da8" and "31eca05faf1d46bed6cd578fb1cc60d8c156f349" have entirely different histories.

3 changed files with 16 additions and 17 deletions

View File

@ -87,13 +87,13 @@ export class TetraGUI extends GUI {
cameraPosition.add(scene.camera, "fov", 0, 200).onChange(() => scene.camera.updateProjectionMatrix()) cameraPosition.add(scene.camera, "fov", 0, 200).onChange(() => scene.camera.updateProjectionMatrix())
let light = dev.addFolder("lights intensity").close() let light = dev.addFolder("lights intensity").close()
light.add(scene.ambientLight, "intensity").name("ambient").min(0).max(20).listen() light.add(scene.ambientLight, "intensity").name("ambient").min(0).max(20)
light.add(scene.directionalLight, "intensity").name("directional").min(0).max(20).listen() light.add(scene.directionalLight, "intensity").name("directional").min(0).max(20)
let directionalLightPosition = dev.addFolder("directionalLight.position").close() let directionalLightPosition = dev.addFolder("directionalLight.position").close()
directionalLightPosition.add(scene.directionalLight.position, "x").listen() directionalLightPosition.add(scene.directionalLight.position, "x")
directionalLightPosition.add(scene.directionalLight.position, "y").listen() directionalLightPosition.add(scene.directionalLight.position, "y")
directionalLightPosition.add(scene.directionalLight.position, "z").listen() directionalLightPosition.add(scene.directionalLight.position, "z")
let vortex = dev.addFolder("vortex opacity").close() let vortex = dev.addFolder("vortex opacity").close()
vortex.add(scene.vortex.darkCylinder.material, "opacity").name("dark").min(0).max(1) vortex.add(scene.vortex.darkCylinder.material, "opacity").name("dark").min(0).max(1)

View File

@ -49,17 +49,14 @@ export class TetraScene extends THREE.Scene {
case "Plasma": case "Plasma":
this.ambientLight.intensity = 0.6 this.ambientLight.intensity = 0.6
this.directionalLight.intensity = 5 this.directionalLight.intensity = 5
this.directionalLight.position.set(5, -20, 20) break
break
case "Espace": case "Espace":
this.ambientLight.intensity = 20 this.ambientLight.intensity = 20
this.directionalLight.intensity = 10 this.directionalLight.intensity = 10
this.directionalLight.position.set(5, -20, 20)
break break
case "Rétro": case "Rétro":
this.ambientLight.intensity = 1 this.ambientLight.intensity = 1
this.directionalLight.intensity = 10 this.directionalLight.intensity = 10
this.directionalLight.position.set(19, 120, 200)
break break
} }
this.vortex.theme = theme this.vortex.theme = theme

View File

@ -17,10 +17,9 @@ const COLORS = {
S: 0xC8FBA8, S: 0xC8FBA8,
T: 0xedb2ff, T: 0xedb2ff,
Z: 0xffb8c5, Z: 0xffb8c5,
LOCKING: 0xffffff, LOCKING: "white",
GHOST: 0x99a9b2, GHOST: 0x99a9b2,
EDGE: 0x88abe0, EDGE: 0x88abe0
RETRO: 0xffffff,
} }
const TRANSLATION = { const TRANSLATION = {
@ -95,7 +94,10 @@ class InstancedMino extends THREE.InstancedMesh {
} }
resetColor() { resetColor() {
this.instanceColor = null if (this.instanceColor) {
this.instanceColor.array.fill(0xffffff)
this.instanceColor.needsUpdate = true
}
} }
updateColor() { updateColor() {
@ -156,7 +158,7 @@ class Mino extends THREE.Object3D {
color: 0xd0d4c1, color: 0xd0d4c1,
map: texture, map: texture,
bumpMap: texture, bumpMap: texture,
bumpScale: 1.5, bumpScale: 5,
roughness: 0.25, roughness: 0.25,
metalness: 0.8, metalness: 0.8,
transparent: true, transparent: true,
@ -457,8 +459,8 @@ class Playfield extends THREE.Group {
.lineTo(COLUMNS, 0) .lineTo(COLUMNS, 0)
.lineTo(COLUMNS, SKYLINE) .lineTo(COLUMNS, SKYLINE)
.lineTo(COLUMNS + 1, SKYLINE) .lineTo(COLUMNS + 1, SKYLINE)
.lineTo(COLUMNS + 1, -.5) .lineTo(COLUMNS + 1, -1)
.lineTo(-1, -.5) .lineTo(-1, -1)
.moveTo(-1, SKYLINE) .moveTo(-1, SKYLINE)
const retroEdgeTexture = new THREE.TextureLoader(loadingManager).load("images/edge.png", (texture) => { const retroEdgeTexture = new THREE.TextureLoader(loadingManager).load("images/edge.png", (texture) => {
texture.wrapS = THREE.RepeatWrapping texture.wrapS = THREE.RepeatWrapping
@ -513,7 +515,7 @@ class Playfield extends THREE.Group {
this.ghost.visible = false this.ghost.visible = false
this.add(this.ghost) this.add(this.ghost)
// this.visible = true this.visible = true
} }
cellIsEmpty(p) { cellIsEmpty(p) {