fix: updates to fix issues

This commit is contained in:
Mahdi Dibaiee 2018-12-29 14:46:33 +03:30
parent d6eaa09346
commit f08f3bbc7f
8 changed files with 8 additions and 13 deletions

1
.~lock.document.odt# Normal file
View File

@ -0,0 +1 @@
,mahdi,lab,29.12.2018 14:44,file:///home/mahdi/.config/libreoffice/4;

BIN
document.odt Normal file

Binary file not shown.

View File

@ -3,14 +3,14 @@ const audio = {
src: ['assets/audio/fire.wav'], src: ['assets/audio/fire.wav'],
autoplay: true, autoplay: true,
loop: true, loop: true,
volume: 0.3 volume: 0.5
}), }),
music: new Howl({ music: new Howl({
src: ['assets/audio/music.mp3'], src: ['assets/audio/music.mp3'],
autoplay: true, autoplay: true,
loop: true, loop: true,
volume: 0.1, volume: 0.3,
}), }),
rumble: new Howl({ rumble: new Howl({

View File

@ -38,7 +38,7 @@ camera.native.target = ball.native;
ball.checkLife = () => { ball.checkLife = () => {
if (ball.position.x > ground.geometry.parameters.width / 2 if (ball.position.x > ground.geometry.parameters.width / 2
|| 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(); location.reload();
} }
} }

6
src/controls.js vendored
View File

@ -1,5 +1,5 @@
const DFORCE = 6e3; const DFORCE = 6e3;
const AFORCE = 500; const AFORCE = 1e4;
const VFORCE = 1e4; const VFORCE = 1e4;
Mousetrap.bind('left', () => { Mousetrap.bind('left', () => {
@ -19,8 +19,6 @@ Mousetrap.bind('right', () => {
Mousetrap.bind('up', () => { Mousetrap.bind('up', () => {
if (!ball.started) return; if (!ball.started) return;
ball.physics.applyCentralForce({ x: 0, y: 0, z: -AFORCE }); 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', () => { //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.speed = Math.min(config.MAX_SPEED, Math.max(config.FINAL_SPEED, ball.speed - config.SPEED_INCREASE));
////ball.methods.updateVelocity(); ////ball.methods.updateVelocity();
//}); //});

View File

@ -4,10 +4,10 @@ function level0() {
const BOX_SIZE = 100; const BOX_SIZE = 100;
function add({ x, y, z } = {}, { width, depth, height } = {}, rotation = {}) { function add({ x, y, z } = {}, { width, depth, height } = {}, rotation = {}) {
y = y || (tan * z) + BOX_SIZE/2;
width = width || BOX_SIZE; width = width || BOX_SIZE;
height = height || BOX_SIZE; height = height || BOX_SIZE;
depth = depth || BOX_SIZE; depth = depth || BOX_SIZE;
y = y || (tan * z) + height/2;
rotation.x = rotation.x || -step; rotation.x = rotation.x || -step;
const box = new WHS.Box({ const box = new WHS.Box({
@ -125,3 +125,4 @@ function level0() {
} }
} }
level0();

View File

@ -40,7 +40,6 @@ const entrance = () => {
GUI.setStartingTime(); GUI.setStartingTime();
const diff = camera.position.y - ball.position.y; const diff = camera.position.y - ball.position.y;
ball.started = true; ball.started = true;
level0();
audio.rumble.play(); audio.rumble.play();

View File

@ -33,7 +33,7 @@ let ground;
(function groundinit() { (function groundinit() {
const WIDTH = 500; const WIDTH = 500;
const SIZE = 1e5; const SIZE = 3e5;
ground = new WHS.Plane({ ground = new WHS.Plane({
geometry: { geometry: {
width: WIDTH, width: WIDTH,
@ -88,8 +88,6 @@ let ground;
}), }),
}); });
//lava.addTo(app);
//console.log(lava);
ground.add(lava); ground.add(lava);
}()); }());