Commit badd9de6 authored by ogomez92's avatar ogomez92

without xo

parent 71fae6cf
......@@ -11,6 +11,7 @@ class Cone {
this.x =pos.x;
this.y =0;
this.z =pos.z;
this.x=25;this.z=20;
this.sound=son.create("loop_cone");
this.pan=this.sound.effects.add(panner({
panningModel: 'HRTF',
......
......@@ -53,7 +53,7 @@ if (this.input.isJustReleased(KeyEvent.DOM_VK_LEFT))
if (this.input.isJustPressed(KeyEvent.DOM_VK_X))
//speech.speak("velocity: "+this.world.player.car.velocity+" gear: "+this.world.player.car.currentGear+" speed: "+this.world.player.car.speed+" getGear: "+this.world.player.car.getGear());
//speech.speak(this.world.player.alpha);
speech.speak("x"+this.world.player.x+", z"+this.world.player.z);
speech.speak(this.world.player.alpha+", "+"x"+this.world.player.x+", z"+this.world.player.z);
}
}
export {Game}
\ No newline at end of file
......@@ -61,7 +61,7 @@ this.xWall=0;
*/
}
move() {
this.position = [this.x + (Math.sin(this.alpha) * (this.speed)), 0, this.z + (Math.cos(this.alpha) * (this.speed))];
this.position = [this.x + (Math.sin(this.alpha) * (this.speed)), 0, this.z - (Math.cos(this.alpha) * (this.speed))];
this.stepCounter += this.speed;
this.checkWalls();
for (const i of this.world.contents.static) {
......
......@@ -27,7 +27,7 @@ let count=0;
while (!foundWall && count<=12) { //let's not create unending loops
count++;
this.x=this.x + (Math.cos(this.alpha));
this.z=this.z + (Math.sin(this.alpha));
this.z=this.z - (Math.sin(this.alpha));
this.distanceToWall++;
for (let i in this.player.world.contents.static) {
if (this.x==i.x && this.y==i.y) {
......@@ -69,7 +69,7 @@ let count=0;
while (!foundWall && count<=amount) { //let's not create unending loops
count++;
this.x=this.x + (Math.sin(this.alpha));
this.z=this.z + (Math.cos(this.alpha));
this.z=this.z - (Math.cos(this.alpha));
this.distanceToWall++;
//the following if condition checks if either x or z are more than 0 or max grid size.
if (this.x<1 || this.x>this.player.world.size || this.z<1 || this.z>this.player.world.size) {
......
......@@ -26,7 +26,8 @@ export default class World {
this.level=1;
}
set level(v) {
for (let i=1;i<=v*(this.size/2);i++) {
//for (let i=1;i<=v*(this.size/2);i++) {
for (let i=1;i<=1;i++) {
this.contents.static.push(new Cone(this));
}
}
......@@ -43,7 +44,7 @@ this.contents.static.push(new Cone(this));
this.prevPosition=this.player.position;
}
if (this.prevAlpha!=this.player.alpha) {
panner.setListenerOrientation(Math.sin(this.player.alpha), 0, Math.cos(this.player.alpha));
panner.setListenerOrientation(Math.sin(this.player.alpha), 0, Math.cos(this.player.alpha),0,1,0);
this.prevAlpha=this.player.alpha;
}
for (const i of this.contents.dynamic) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment