diff --git a/.~lock.document.odt# b/.~lock.document.odt# new file mode 100644 index 0000000..857653f --- /dev/null +++ b/.~lock.document.odt# @@ -0,0 +1 @@ +,mahdi,lab,29.12.2018 14:44,file:///home/mahdi/.config/libreoffice/4; \ No newline at end of file diff --git a/document.odt b/document.odt new file mode 100644 index 0000000..530894d Binary files /dev/null and b/document.odt differ diff --git a/src/audio.js b/src/audio.js index c41b09c..a261999 100644 --- a/src/audio.js +++ b/src/audio.js @@ -3,14 +3,14 @@ const audio = { src: ['assets/audio/fire.wav'], autoplay: true, loop: true, - volume: 0.3 + volume: 0.5 }), music: new Howl({ src: ['assets/audio/music.mp3'], autoplay: true, loop: true, - volume: 0.1, + volume: 0.3, }), rumble: new Howl({ diff --git a/src/ball.js b/src/ball.js index e405694..d986242 100644 --- a/src/ball.js +++ b/src/ball.js @@ -38,7 +38,7 @@ camera.native.target = ball.native; ball.checkLife = () => { if (ball.position.x > ground.geometry.parameters.width / 2 || ball.position.x < -ground.geometry.parameters.width / 2 - || ball.position.z > -ground.SIZE) { + || ball.position.z < -ground.SIZE) { location.reload(); } } diff --git a/src/controls.js b/src/controls.js index a1e5ac9..025bcca 100644 --- a/src/controls.js +++ b/src/controls.js @@ -1,5 +1,5 @@ const DFORCE = 6e3; -const AFORCE = 500; +const AFORCE = 1e4; const VFORCE = 1e4; Mousetrap.bind('left', () => { @@ -19,8 +19,6 @@ Mousetrap.bind('right', () => { Mousetrap.bind('up', () => { if (!ball.started) return; ball.physics.applyCentralForce({ x: 0, y: 0, z: -AFORCE }); - //ball.speed = Math.min(config.MAX_SPEED, Math.max(config.FINAL_SPEED, ball.speed + config.SPEED_INCREASE)); - //ball.methods.updateVelocity(); }); //Mousetrap.bind('space', () => { @@ -38,5 +36,3 @@ Mousetrap.bind('up', () => { ////ball.speed = Math.min(config.MAX_SPEED, Math.max(config.FINAL_SPEED, ball.speed - config.SPEED_INCREASE)); ////ball.methods.updateVelocity(); //}); - - diff --git a/src/levels/0-basic.js b/src/levels/0-basic.js index c73c153..63b085b 100644 --- a/src/levels/0-basic.js +++ b/src/levels/0-basic.js @@ -4,10 +4,10 @@ function level0() { const BOX_SIZE = 100; function add({ x, y, z } = {}, { width, depth, height } = {}, rotation = {}) { - y = y || (tan * z) + BOX_SIZE/2; width = width || BOX_SIZE; height = height || BOX_SIZE; depth = depth || BOX_SIZE; + y = y || (tan * z) + height/2; rotation.x = rotation.x || -step; const box = new WHS.Box({ @@ -125,3 +125,4 @@ function level0() { } } +level0(); diff --git a/src/scenes.js b/src/scenes.js index 1d47f9f..fce276e 100644 --- a/src/scenes.js +++ b/src/scenes.js @@ -40,7 +40,6 @@ const entrance = () => { GUI.setStartingTime(); const diff = camera.position.y - ball.position.y; ball.started = true; - level0(); audio.rumble.play(); diff --git a/src/world.js b/src/world.js index 25784dc..42b42fc 100644 --- a/src/world.js +++ b/src/world.js @@ -33,7 +33,7 @@ let ground; (function groundinit() { const WIDTH = 500; - const SIZE = 1e5; + const SIZE = 3e5; ground = new WHS.Plane({ geometry: { width: WIDTH, @@ -88,8 +88,6 @@ let ground; }), }); - //lava.addTo(app); - //console.log(lava); ground.add(lava); }());