implement settings and controls screen

This commit is contained in:
LabyStudio
2022-02-05 16:58:30 +01:00
parent 52427e610d
commit e1c5ccfa89
10 changed files with 108 additions and 14 deletions
+4 -4
View File
@@ -311,9 +311,9 @@ window.Player = class {
let sneaking = false;
if (this.minecraft.hasInGameFocus()) {
if (Keyboard.isKeyDown("KeyR")) { // R
/*if (Keyboard.isKeyDown("KeyR")) { // R
this.respawn();
}
}*/
if (Keyboard.isKeyDown("KeyW")) { // W
moveForward++;
}
@@ -329,14 +329,14 @@ window.Player = class {
if (Keyboard.isKeyDown("Space")) { // Space
jumping = true;
}
if (Keyboard.isKeyDown("ShiftLeft")) { // Shift
if (Keyboard.isKeyDown(this.minecraft.settings.sprinting)) {
if (this.moveForward > 0 && !this.sneaking && !this.sprinting && this.motionX !== 0 && this.motionZ !== 0) {
this.sprinting = true;
this.updateFOVModifier();
}
}
if (Keyboard.isKeyDown("KeyQ")) { // Q
if (Keyboard.isKeyDown(this.minecraft.settings.crouching)) { // Q
sneaking = true;
}