diff --git a/levels/First-Year/First-Year.js b/levels/First-Year/First-Year.js index 2fc1f21..1051d10 100644 --- a/levels/First-Year/First-Year.js +++ b/levels/First-Year/First-Year.js @@ -28,7 +28,7 @@ class FirstLevel extends Game { numTokensText.textContent = `${0}/${1}`; // Add Post-Processing Effects - // this._PostProcessing(); + this._PostProcessing(); } _PostProcessing() { diff --git a/levels/Second-Year/Second-Year.js b/levels/Second-Year/Second-Year.js index 4698ca0..e5d1914 100644 --- a/levels/Second-Year/Second-Year.js +++ b/levels/Second-Year/Second-Year.js @@ -23,13 +23,11 @@ class SecondYear extends Game { this._AddSecondTokens(); } _AddSecondTokens() { - console.log("Adding Second Token!"); - /*source: https://sketchfab.com/3d-models/batman-arkham-asylum-harley-quinn-46b5868a4a8d4a2b9389221a039b24b2 author: EWTube0 (https://sketchfab.com/EWTube0) */ let loaderObj = new GLTFLoader(); loaderObj.load( - "../../../assets/models/tokens/batman/scene.gltf", + "../../assets/models/tokens/batman/scene.gltf", (gltf) => { let token = new Token(); token.object = gltf.scene; @@ -43,12 +41,6 @@ class SecondYear extends Game { this.setKeyPos(token); this.totalKeys += 1; numTokensText.textContent=`${0}/${2}`; - console.log( - "This is the second token position " + - token.object.position.x + - " " + - token.object.position.z - ); //token.object.position.set(this.player.position.x + 2, this.player.position.y, this.player.position.z ); token.sound = new THREE.PositionalAudio(this.AudioListener); token.object.add(token.sound); diff --git a/levels/Third-Year/Third-Year.js b/levels/Third-Year/Third-Year.js index b9089b3..6a18bc8 100644 --- a/levels/Third-Year/Third-Year.js +++ b/levels/Third-Year/Third-Year.js @@ -26,19 +26,17 @@ class ThirdYear extends Game { ); this._AddSecondTokens(); - this._PostProcessing(); + // this._PostProcessing(); this.nextLevel = "/~sjmsp/"; this.restartLevel = "/~sjmsp/levels/Third-Year/Third-Year.html"; } _AddSecondTokens() { - console.log("Adding Second Token!"); - /*source: https://sketchfab.com/3d-models/scary-acoustic-guitar-c7022e2914a34189ab11ce5c1240249e author: yotam92 (https://sketchfab.com/yotam92) */ let loaderObj = new GLTFLoader(); loaderObj.load( - "../../../assets/models/tokens/guitar/scene.gltf", + "../../assets/models/tokens/guitar/scene.gltf", (gltf) => { let token = new Token(); token.object = gltf.scene; @@ -68,7 +66,7 @@ author: yotam92 (https://sketchfab.com/yotam92) */ ); /*source: https://sketchfab.com/3d-models/graduation-86895e10baf54c46896823394766fb86 author: Cyberluna (https://sketchfab.com/cyberluna) */ - loaderObj.load("../../../assets/models/tokens/grad/scene.gltf", (gltf) => { + loaderObj.load("../../assets/models/tokens/grad/scene.gltf", (gltf) => { let token2 = new Token(); token2.object = gltf.scene; token2.object.scale.set(0.1, 0.1, 0.1); diff --git a/utilities/Game.js b/utilities/Game.js index 24c45a5..3090316 100644 --- a/utilities/Game.js +++ b/utilities/Game.js @@ -1092,12 +1092,6 @@ class Game { token.loaded = true; this.onTokenLoaded(token); this.setKeyPos(token); - console.log( - "This is the first token position " + - token.object.position.x + - " " + - token.object.position.z - ); token.sound = new THREE.PositionalAudio(this.AudioListener); token.object.add(token.sound); @@ -1127,7 +1121,6 @@ class Game { author: EWTube0 (https://sketchfab.com/EWTube0)*/ let loaderObj = new GLTFLoader(); loaderObj.load("../../assets/models/characters/npc/scene.gltf", (gltf) => { - console.log("Spawning npc: " + this.npcId); let t_npc = new NPC(); let result = t_npc.getNPC(this.npcId); t_npc.mesh = gltf.scene; @@ -1194,7 +1187,6 @@ author: EWTube0 (https://sketchfab.com/EWTube0)*/ hurt() { this.currentHealth -= 1; - console.log(this.currentHealth); if (this.currentHealth < 0 && this.playerLives != 0) { if (this.playerLives == 3) { Heart1.style.display = "none"; @@ -1352,7 +1344,6 @@ author: EWTube0 (https://sketchfab.com/EWTube0)*/ if (!this.npcDeathNoise.isPlaying) { this.npcDeathNoise.play(); } - console.log(this.npcDeathFrames[i]); this.enemy[i].translateY(0.5 * this.npcDeathFrames[i]); this.npcDeathFrames[i]++; } else { @@ -1791,7 +1782,7 @@ author: EWTube0 (https://sketchfab.com/EWTube0)*/ this.visualise(this.maze); // Visualises the maze this.exit(); // Adds the exit door this.enter(); // Adds the entry door - // this.bounds(); // Adds invisible boundaries to the starting area + this.bounds(); // Adds invisible boundaries to the starting area } /** diff --git a/utilities/NPC.js b/utilities/NPC.js index 0320082..d86ce8c 100644 --- a/utilities/NPC.js +++ b/utilities/NPC.js @@ -92,14 +92,12 @@ class NPC { enemyX = Math.round(enemyX/5) * 5; enemyZ = Math.round(enemyZ/5) * 5; mazeCopy[Math.floor(enemyZ / 5 + 10)][Math.floor(enemyX / 5 + 10)] = 2; - //console.log("Enemy z " + enemyZ); - //mazeCopy[10][10] = 3; + const playerPos = player.position.clone(); let playerX = 0; let playerZ = 0; - - // console.log(`z pos = ${playerPos.z}\nFloor = ${Math.floor(playerPos.z)}`); + if ( Math.abs(Math.floor(playerPos.x) - playerPos.x) <= Math.abs(Math.ceil(playerPos.x) - playerPos.x) @@ -130,16 +128,6 @@ class NPC { let path = aStar.findPathAStar(); if (path.length > 1) { - //path.shift(); - // console.log( - // "Enemy Z: " + (enemyZ / 5 + 10) + " Enemy X: " + (enemyX / 5 + 10) - // ); - // console.log( - // "Player Z: " + (playerZ / 5 + 10) + " Player Z: " + (playerX / 5 + 10) - // ); - // console.log("Current path place: " + path[0]); - // console.log("Next path place: " + path[1]); - console.log(path.length); if(!this.dead){ if(path.length < 50 && path.length > 25){ this.humm.stop(); @@ -153,9 +141,6 @@ class NPC { } } } - // if ((path[0][0] != (enemyZ / 5 + 10)) && ((path[0][1] != (enemyZ / 5 + 10)))){ - // path.shift(); - // } enemyPath.clear(); @@ -164,12 +149,12 @@ class NPC { new YUKA.Vector3(5 * (path[i][1] - 10), 1, 5 * (path[i][0] - 10)) ); } - // vehicle.position.copy(enemy.position); + vehicle.maxSpeed = 5; mazeCopy[Math.floor(enemyZ / 5 + 10)][Math.floor(enemyX / 5 + 10)] = 0; - //enemy.position.copy(enemyPath.current()); + const followPathBehavior = new YUKA.FollowPathBehavior(enemyPath, 0.1); vehicle.steering.clear(); @@ -177,9 +162,6 @@ class NPC { const onPathBehavior = new YUKA.OnPathBehavior(enemyPath); vehicle.steering.add(onPathBehavior); - - // entityManager.clear(); - // entityManager.add(vehicle); } } } diff --git a/vite.config.js b/vite.config.js index 32912e8..7a4f2d2 100644 --- a/vite.config.js +++ b/vite.config.js @@ -22,7 +22,6 @@ export default defineConfig({ rollupOptions: { input: { main: path.resolve(__dirname, 'index.html'), - intro: path.resolve(__dirname, 'intro.html'), FirstYear: path.resolve(__dirname, 'levels/First-Year/First-Year.html'), SecondYear: path.resolve(__dirname, 'levels/Second-Year/Second-Year.html'), ThirdYear: path.resolve(__dirname, 'levels/Third-Year/Third-Year.html'),