Skip to content

Commit

Permalink
Merge pull request #2 from Zinglish/master
Browse files Browse the repository at this point in the history
Added left right strafing instead of A and D being rotational
  • Loading branch information
Lallassu committed Nov 1, 2017
2 parents 54e4274 + 70cbd16 commit d6c93e1
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions js/char.js
Expand Up @@ -1177,12 +1177,20 @@ function Player(x, y, z) {
}
}
if (this.keyboard.pressed("A")) {
this.chunk.mesh.rotation.y += (this.speed * delta / 7);
this.moving = true;
this.chunk.mesh.translateX(this.speed * delta);
if(this.cd()) {
this.moving = true;
} else {
this.chunk.mesh.translateX(-this.speed * delta);
}
}
if (this.keyboard.pressed("D")) {
this.chunk.mesh.rotation.y -= (this.speed * delta / 7);
this.moving = true;
this.chunk.mesh.translateX(-this.speed * delta);
if(this.cd()) {
this.moving = true;
} else {
this.chunk.mesh.translateX(this.speed * delta);
}
}
if (this.keyboard.pressed("R")) {
this.flashlight.visible = false;
Expand Down

0 comments on commit d6c93e1

Please sign in to comment.