Added debug bool

Used to enable spamming of the player position in the browser console
This commit is contained in:
2023-11-29 09:18:20 +01:00
parent 95a71de2bb
commit 800c3fd275
2 changed files with 4 additions and 1 deletions

View File

@@ -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