diff --git a/src/main.js b/src/main.js index 66cf3d6..eda827d 100644 --- a/src/main.js +++ b/src/main.js @@ -6,6 +6,8 @@ import * as Animations from './utils/animateMesh.js'; let Clock = new THREE.Clock(); THREE.Cache.enabled = true;//So we can request several time the same file without worrying : https://threejs.org/docs/#api/en/loaders/FileLoader +const APP_DEBUG = false;//Turn true to show player position in browser console + /* --------------------- */ /* | SCENE CREATION | */ /* --------------------- */ @@ -38,6 +40,8 @@ Animations.addAnimationMixerOnMesh(assets.player, ["Walk"]); function animate() { requestAnimationFrame( animate ); + if(APP_DEBUG)console.log("Player position X : "+assets.player.scene.position.x+ " Y : "+assets.player.scene.position.y); + PlayerMovement.updatePlayerPositionAnimation(assets.player, camera, scene);//Updating player position and rotation Animations.updateAnimations(Clock.getDelta());//Playing animations diff --git a/src/utils/playerMovement.js b/src/utils/playerMovement.js index 834c783..143bb3a 100644 --- a/src/utils/playerMovement.js +++ b/src/utils/playerMovement.js @@ -63,7 +63,6 @@ export function handleKeyDown(event) { for(let i=0; icollisionThreshold && intersects[i].distance