change colorful background, rename themes
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 330 KiB After Width: | Height: | Size: 821 KiB |
@@ -26,7 +26,7 @@ export class Menu extends GUI {
|
|||||||
this.settings = this.addFolder("Options")
|
this.settings = this.addFolder("Options")
|
||||||
this.settings.add(settings, "startLevel").name("Niveau initial").min(1).max(15).step(1)
|
this.settings.add(settings, "startLevel").name("Niveau initial").min(1).max(15).step(1)
|
||||||
|
|
||||||
this.settings.add(settings, "theme", ["Plasma", "Espace", "Rétro"]).name("Thème").onChange(theme => {
|
this.settings.add(settings, "theme", ["Plasma", "Space", "Retro"]).name("Thème").onChange(theme => {
|
||||||
scene.theme = theme
|
scene.theme = theme
|
||||||
if (dev) changeMaterial()
|
if (dev) changeMaterial()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ let jsKeyRenamer = new Proxy({
|
|||||||
["→"]: "ArrowRight",
|
["→"]: "ArrowRight",
|
||||||
["↑"]: "ArrowUp",
|
["↑"]: "ArrowUp",
|
||||||
["↓"]: "ArrowDown",
|
["↓"]: "ArrowDown",
|
||||||
["Espace"]: " ",
|
["Space"]: " ",
|
||||||
["Échap."]: "Escape",
|
["Échap."]: "Escape",
|
||||||
["Ret. arrière"]: "Backspace",
|
["Ret. arrière"]: "Backspace",
|
||||||
["Entrée"]: "Enter",
|
["Entrée"]: "Enter",
|
||||||
@@ -17,7 +17,7 @@ let friendyKeyRenamer = new Proxy({
|
|||||||
["ArrowRight"]: "→",
|
["ArrowRight"]: "→",
|
||||||
["ArrowUp"]: "↑",
|
["ArrowUp"]: "↑",
|
||||||
["ArrowDown"]: "↓",
|
["ArrowDown"]: "↓",
|
||||||
[" "]: "Espace",
|
[" "]: "Space",
|
||||||
["Escape"]: "Échap.",
|
["Escape"]: "Échap.",
|
||||||
["Backspace"]: "Ret. arrière",
|
["Backspace"]: "Ret. arrière",
|
||||||
["Enter"]: "Entrée",
|
["Enter"]: "Entrée",
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export class TetraScene extends THREE.Scene {
|
|||||||
switch (theme) {
|
switch (theme) {
|
||||||
case "Plasma":
|
case "Plasma":
|
||||||
this.ambientLight.intensity = 0
|
this.ambientLight.intensity = 0
|
||||||
this.directionalLight.intensity = 5
|
this.directionalLight.intensity = 3
|
||||||
this.directionalLight.position.set(5, -20, 20)
|
this.directionalLight.position.set(5, -20, 20)
|
||||||
this.music.src = "audio/Moon-Over-Moscow-DJ-ResiDance-Mix-2022.mp3"
|
this.music.src = "audio/Moon-Over-Moscow-DJ-ResiDance-Mix-2022.mp3"
|
||||||
this.background = new THREE.Color(0xffffff)
|
this.background = new THREE.Color(0xffffff)
|
||||||
@@ -80,8 +80,8 @@ export class TetraScene extends THREE.Scene {
|
|||||||
this.playfield.edge.visible = true
|
this.playfield.edge.visible = true
|
||||||
this.playfield.retroEdge.visible = false
|
this.playfield.retroEdge.visible = false
|
||||||
break
|
break
|
||||||
case "Espace":
|
case "Space":
|
||||||
this.ambientLight.intensity = 2
|
this.ambientLight.intensity = 5
|
||||||
this.directionalLight.intensity = 10
|
this.directionalLight.intensity = 10
|
||||||
this.directionalLight.position.set(2, 15, 20)
|
this.directionalLight.position.set(2, 15, 20)
|
||||||
this.music.src = "audio/benevolence.m4a"
|
this.music.src = "audio/benevolence.m4a"
|
||||||
@@ -90,7 +90,7 @@ export class TetraScene extends THREE.Scene {
|
|||||||
this.playfield.edge.visible = true
|
this.playfield.edge.visible = true
|
||||||
this.playfield.retroEdge.visible = false
|
this.playfield.retroEdge.visible = false
|
||||||
break
|
break
|
||||||
case "Rétro":
|
case "Retro":
|
||||||
this.ambientLight.intensity = 1
|
this.ambientLight.intensity = 1
|
||||||
this.directionalLight.intensity = 10
|
this.directionalLight.intensity = 10
|
||||||
this.directionalLight.position.set(19, 120, 200)
|
this.directionalLight.position.set(19, 120, 200)
|
||||||
|
|||||||
@@ -79,17 +79,17 @@ export class InstancedMino extends THREE.InstancedMesh {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set theme(theme) {
|
set theme(theme) {
|
||||||
if (theme == "Rétro") {
|
if (theme == "Retro") {
|
||||||
this.resetColor()
|
this.resetColor()
|
||||||
this.update = this.updateOffset
|
this.update = this.updateOffset
|
||||||
if (this.materials["Rétro"]) {
|
if (this.materials["Retro"]) {
|
||||||
this.material = this.materials["Rétro"]
|
this.material = this.materials["Retro"]
|
||||||
} else {
|
} else {
|
||||||
this.materials["Rétro"] = []
|
this.materials["Retro"] = []
|
||||||
const loadingManager = new THREE.LoadingManager(() => this.material = this.materials["Rétro"])
|
const loadingManager = new THREE.LoadingManager(() => this.material = this.materials["Retro"])
|
||||||
new THREE.TextureLoader(loadingManager).load("images/sprites.png", (texture) => {
|
new THREE.TextureLoader(loadingManager).load("images/sprites.png", (texture) => {
|
||||||
this.materials.Rétro[4] =
|
this.materials.Retro[4] =
|
||||||
this.materials.Rétro[5] = new TileMaterial({
|
this.materials.Retro[5] = new TileMaterial({
|
||||||
color: COLORS.RETRO,
|
color: COLORS.RETRO,
|
||||||
map: texture,
|
map: texture,
|
||||||
bumpMap: texture,
|
bumpMap: texture,
|
||||||
@@ -100,10 +100,10 @@ export class InstancedMino extends THREE.InstancedMesh {
|
|||||||
}, 8, 8)
|
}, 8, 8)
|
||||||
})
|
})
|
||||||
new THREE.TextureLoader(loadingManager).load("images/edges.png", (texture) => {
|
new THREE.TextureLoader(loadingManager).load("images/edges.png", (texture) => {
|
||||||
this.materials.Rétro[0] =
|
this.materials.Retro[0] =
|
||||||
this.materials.Rétro[1] =
|
this.materials.Retro[1] =
|
||||||
this.materials.Rétro[2] =
|
this.materials.Retro[2] =
|
||||||
this.materials.Rétro[3] = new TileMaterial({
|
this.materials.Retro[3] = new TileMaterial({
|
||||||
color: COLORS.RETRO,
|
color: COLORS.RETRO,
|
||||||
map: texture,
|
map: texture,
|
||||||
bumpMap: texture,
|
bumpMap: texture,
|
||||||
@@ -168,7 +168,7 @@ InstancedMino.prototype.materials = {
|
|||||||
roughness: 0.5,
|
roughness: 0.5,
|
||||||
metalness: 0.9,
|
metalness: 0.9,
|
||||||
}),
|
}),
|
||||||
Espace: new THREE.MeshStandardMaterial({
|
Space: new THREE.MeshStandardMaterial({
|
||||||
envMap: environment,
|
envMap: environment,
|
||||||
side: THREE.DoubleSide,
|
side: THREE.DoubleSide,
|
||||||
transparent: true,
|
transparent: true,
|
||||||
|
|||||||
@@ -66,13 +66,13 @@ export class Vortex extends THREE.Group {
|
|||||||
this.visible = true
|
this.visible = true
|
||||||
break
|
break
|
||||||
|
|
||||||
case "Espace":
|
case "Space":
|
||||||
new THREE.TextureLoader(this.loadingManager).load("./images/colorfull.jpg", texture => {
|
new THREE.TextureLoader(this.loadingManager).load("./images/colorfull.jpg", texture => {
|
||||||
texture.wrapS = THREE.RepeatWrapping
|
texture.wrapS = THREE.RepeatWrapping
|
||||||
texture.wrapT = THREE.MirroredRepeatWrapping
|
texture.wrapT = THREE.MirroredRepeatWrapping
|
||||||
texture.repeat.set(2, 4)
|
texture.repeat.set(1, 4)
|
||||||
this.transparentCylinder.material.map = texture
|
this.transparentCylinder.material.map = texture
|
||||||
this.transparentCylinder.material.opacity = 0.15
|
this.transparentCylinder.material.opacity = 0.3
|
||||||
})
|
})
|
||||||
|
|
||||||
new THREE.TextureLoader(this.loadingManager).load("./images/stars_space.jpg", texture => {
|
new THREE.TextureLoader(this.loadingManager).load("./images/stars_space.jpg", texture => {
|
||||||
@@ -87,12 +87,12 @@ export class Vortex extends THREE.Group {
|
|||||||
this.opaqueTextureRotation = 0.006
|
this.opaqueTextureRotation = 0.006
|
||||||
this.opaqueMoveForward = 0.03
|
this.opaqueMoveForward = 0.03
|
||||||
this.transparentTextureRotation = 0.006
|
this.transparentTextureRotation = 0.006
|
||||||
this.transparentMoveForward = 0.04
|
this.transparentMoveForward = 0.06
|
||||||
|
|
||||||
this.visible = true
|
this.visible = true
|
||||||
break
|
break
|
||||||
|
|
||||||
case "Rétro":
|
case "Retro":
|
||||||
this.visible = false
|
this.visible = false
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user