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.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
|
||||
if (dev) changeMaterial()
|
||||
})
|
||||
|
||||
@@ -3,7 +3,7 @@ let jsKeyRenamer = new Proxy({
|
||||
["→"]: "ArrowRight",
|
||||
["↑"]: "ArrowUp",
|
||||
["↓"]: "ArrowDown",
|
||||
["Espace"]: " ",
|
||||
["Space"]: " ",
|
||||
["Échap."]: "Escape",
|
||||
["Ret. arrière"]: "Backspace",
|
||||
["Entrée"]: "Enter",
|
||||
@@ -17,7 +17,7 @@ let friendyKeyRenamer = new Proxy({
|
||||
["ArrowRight"]: "→",
|
||||
["ArrowUp"]: "↑",
|
||||
["ArrowDown"]: "↓",
|
||||
[" "]: "Espace",
|
||||
[" "]: "Space",
|
||||
["Escape"]: "Échap.",
|
||||
["Backspace"]: "Ret. arrière",
|
||||
["Enter"]: "Entrée",
|
||||
|
||||
@@ -72,7 +72,7 @@ export class TetraScene extends THREE.Scene {
|
||||
switch (theme) {
|
||||
case "Plasma":
|
||||
this.ambientLight.intensity = 0
|
||||
this.directionalLight.intensity = 5
|
||||
this.directionalLight.intensity = 3
|
||||
this.directionalLight.position.set(5, -20, 20)
|
||||
this.music.src = "audio/Moon-Over-Moscow-DJ-ResiDance-Mix-2022.mp3"
|
||||
this.background = new THREE.Color(0xffffff)
|
||||
@@ -80,8 +80,8 @@ export class TetraScene extends THREE.Scene {
|
||||
this.playfield.edge.visible = true
|
||||
this.playfield.retroEdge.visible = false
|
||||
break
|
||||
case "Espace":
|
||||
this.ambientLight.intensity = 2
|
||||
case "Space":
|
||||
this.ambientLight.intensity = 5
|
||||
this.directionalLight.intensity = 10
|
||||
this.directionalLight.position.set(2, 15, 20)
|
||||
this.music.src = "audio/benevolence.m4a"
|
||||
@@ -90,7 +90,7 @@ export class TetraScene extends THREE.Scene {
|
||||
this.playfield.edge.visible = true
|
||||
this.playfield.retroEdge.visible = false
|
||||
break
|
||||
case "Rétro":
|
||||
case "Retro":
|
||||
this.ambientLight.intensity = 1
|
||||
this.directionalLight.intensity = 10
|
||||
this.directionalLight.position.set(19, 120, 200)
|
||||
|
||||
@@ -79,17 +79,17 @@ export class InstancedMino extends THREE.InstancedMesh {
|
||||
}
|
||||
|
||||
set theme(theme) {
|
||||
if (theme == "Rétro") {
|
||||
if (theme == "Retro") {
|
||||
this.resetColor()
|
||||
this.update = this.updateOffset
|
||||
if (this.materials["Rétro"]) {
|
||||
this.material = this.materials["Rétro"]
|
||||
if (this.materials["Retro"]) {
|
||||
this.material = this.materials["Retro"]
|
||||
} else {
|
||||
this.materials["Rétro"] = []
|
||||
const loadingManager = new THREE.LoadingManager(() => this.material = this.materials["Rétro"])
|
||||
this.materials["Retro"] = []
|
||||
const loadingManager = new THREE.LoadingManager(() => this.material = this.materials["Retro"])
|
||||
new THREE.TextureLoader(loadingManager).load("images/sprites.png", (texture) => {
|
||||
this.materials.Rétro[4] =
|
||||
this.materials.Rétro[5] = new TileMaterial({
|
||||
this.materials.Retro[4] =
|
||||
this.materials.Retro[5] = new TileMaterial({
|
||||
color: COLORS.RETRO,
|
||||
map: texture,
|
||||
bumpMap: texture,
|
||||
@@ -100,10 +100,10 @@ export class InstancedMino extends THREE.InstancedMesh {
|
||||
}, 8, 8)
|
||||
})
|
||||
new THREE.TextureLoader(loadingManager).load("images/edges.png", (texture) => {
|
||||
this.materials.Rétro[0] =
|
||||
this.materials.Rétro[1] =
|
||||
this.materials.Rétro[2] =
|
||||
this.materials.Rétro[3] = new TileMaterial({
|
||||
this.materials.Retro[0] =
|
||||
this.materials.Retro[1] =
|
||||
this.materials.Retro[2] =
|
||||
this.materials.Retro[3] = new TileMaterial({
|
||||
color: COLORS.RETRO,
|
||||
map: texture,
|
||||
bumpMap: texture,
|
||||
@@ -168,7 +168,7 @@ InstancedMino.prototype.materials = {
|
||||
roughness: 0.5,
|
||||
metalness: 0.9,
|
||||
}),
|
||||
Espace: new THREE.MeshStandardMaterial({
|
||||
Space: new THREE.MeshStandardMaterial({
|
||||
envMap: environment,
|
||||
side: THREE.DoubleSide,
|
||||
transparent: true,
|
||||
|
||||
@@ -66,13 +66,13 @@ export class Vortex extends THREE.Group {
|
||||
this.visible = true
|
||||
break
|
||||
|
||||
case "Espace":
|
||||
case "Space":
|
||||
new THREE.TextureLoader(this.loadingManager).load("./images/colorfull.jpg", texture => {
|
||||
texture.wrapS = THREE.RepeatWrapping
|
||||
texture.wrapT = THREE.MirroredRepeatWrapping
|
||||
texture.repeat.set(2, 4)
|
||||
texture.repeat.set(1, 4)
|
||||
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 => {
|
||||
@@ -87,12 +87,12 @@ export class Vortex extends THREE.Group {
|
||||
this.opaqueTextureRotation = 0.006
|
||||
this.opaqueMoveForward = 0.03
|
||||
this.transparentTextureRotation = 0.006
|
||||
this.transparentMoveForward = 0.04
|
||||
this.transparentMoveForward = 0.06
|
||||
|
||||
this.visible = true
|
||||
break
|
||||
|
||||
case "Rétro":
|
||||
case "Retro":
|
||||
this.visible = false
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user