Skip to content

Commit b0b2c14

Browse files
committed
FOV in gui
1 parent 52d9d70 commit b0b2c14

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Build and Deploy](https://github.com/michaljaz/web-minecraft/actions/workflows/github-pages.yaml/badge.svg)](https://github.com/michaljaz/web-minecraft/actions/workflows/github-pages.yaml)
66
## About
77

8-
**Web-minecraft is minecraft client written in Javascript.** From web browser this client connects to proxy(https://github.com/michaljaz/web-minecraft-proxy) that translates Websocket connection to TCP and then to real minecraft server, so you can play minecraft in the browser. Web-minecraft now only supports minecraft 1.16.5.
8+
**Web-minecraft is minecraft client written in Javascript.** From web browser this client connects to [proxy](https://github.com/michaljaz/web-minecraft-proxy) that translates Websocket connection to TCP and then to real minecraft server, so you can play minecraft in the browser. Web-minecraft now only supports minecraft 1.16.5.
99

1010
## Demo
1111
Live demo with no installation: https://minecraft.js.org.

src/scripts/Setup.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ function Setup (game) {
6666
chunkdist: 4
6767
}
6868
game.distanceBasedFog.updateDistance(game.params.chunkdist)
69-
gui
70-
.add(game.world.material, 'wireframe')
71-
.name('Wireframe')
72-
.listen()
7369
gui
7470
.add(game.params, 'chunkdist', 2, 10, 1)
7571
.name('Render distance')
@@ -79,6 +75,15 @@ function Setup (game) {
7975
}
8076
})
8177
.listen()
78+
gui
79+
.add(game.fov, 'normal', 30, 110, 1)
80+
.name('FOV')
81+
.onChange(function (val) {
82+
game.fov.sprint = game.fov.normal + 10
83+
game.camera.fov = game.fov.normal
84+
game.camera.updateProjectionMatrix()
85+
})
86+
.listen()
8287
gui
8388
.add(game.distanceBasedFog, 'visible')
8489
.name('Enable fog')
@@ -94,6 +99,10 @@ function Setup (game) {
9499
.add(game.world.chunkManager, 'smooth')
95100
.name('Smooth chunks')
96101
.listen()
102+
gui
103+
.add(game.world.material, 'wireframe')
104+
.name('Wireframe')
105+
.listen()
97106
game.eh = new EventHandler(game)
98107
}
99108

0 commit comments

Comments
 (0)