11
2- import * as THREE from ' ./build/three.module.js'
3- import {SkeletonUtils} from ' ./jsm/utils/SkeletonUtils.js'
4- import Stats from ' ./jsm/libs/stats.module.js'
5- import {World} from ' ./World/World.js'
6- import {FirstPersonControls} from ' ./FirstPersonControls.js'
7- import {gpuInfo} from ' ./gpuInfo.js'
8- import {AssetLoader} from ' ./AssetLoader.js'
9- import {InventoryBar} from ' ./InventoryBar.js'
10- import {RandomNick} from ' ./RandomNick.js'
11- import {GUI} from ' ./jsm/libs/dat.gui.module.js'
12- import {Chat} from ' ./Chat.js'
13- import {Entities} from ' ./Entities.js'
14- import {PlayerInInventory} from ' ./PlayerInInventory.js'
15- import {BlockBreak} from ' ./BlockBreak.js'
16- import {BlockPlace} from ' ./BlockPlace.js'
17- import io from ' socket.io-client'
2+ import * as THREE from " three"
3+ import Stats from " stats-js"
4+ import * as dat from " dat.gui"
5+ import io from " socket.io-client"
186import TWEEN from " @tweenjs/tween.js"
7+ import {World} from " ./World/World.js"
8+ import {FirstPersonControls} from " ./FirstPersonControls.js"
9+ import {gpuInfo} from " ./gpuInfo.js"
10+ import {AssetLoader} from " ./AssetLoader.js"
11+ import {InventoryBar} from " ./InventoryBar.js"
12+ import {RandomNick} from " ./RandomNick.js"
13+ import {Chat} from " ./Chat.js"
14+ import {Entities} from " ./Entities.js"
15+ import {PlayerInInventory} from " ./PlayerInInventory.js"
16+ import {BlockBreak} from " ./BlockBreak.js"
17+ import {BlockPlace} from " ./BlockPlace.js"
1918
2019class Game
2120 constructor : (options )->
@@ -29,8 +28,8 @@ class Game
2928 @fov = 70
3029 @toxelSize = 27
3130 @cellSize = 16
32- @canvas = document .querySelector ' #c '
33- @pcanvas = document .querySelector ' #c_player'
31+ @canvas = document .querySelector " #c "
32+ @pcanvas = document .querySelector " #c_player"
3433
3534 @socket = io .connect " :8081"
3635
@@ -55,7 +54,7 @@ class Game
5554 document .location .href = " \# #{ @nick } "
5655
5756 @stats = new Stats
58- @drawcalls = @stats .addPanel new Stats.Panel ( ' calls' , ' #ff8' , ' #221' )
57+ @drawcalls = @stats .addPanel new Stats.Panel ( " calls" , " #ff8" , " #221" )
5958 @stats .showPanel 3
6059 document .body .appendChild @stats .dom
6160
@@ -71,7 +70,7 @@ class Game
7170 eventMap = {
7271 " connect " : ()->
7372 console .log " Połączono z serverem!"
74- $ (' .loadingText' ).text " Za chwilę dołączysz do gry..."
73+ $ (" .loadingText" ).text " Za chwilę dołączysz do gry..."
7574 console .log " User nick: #{ _this .nick } "
7675 _this .socket .emit " initClient" ,
7776 nick : _this .nick
@@ -135,21 +134,21 @@ class Game
135134 @socket .on i,eventMap[i]
136135
137136
138- gui = new GUI ()
137+ gui = new dat. GUI
139138 @params =
140139 fog : false
141140 chunkdist : 3
142141 color = new THREE.Color " #adc8ff"
143142 near = 0.5 * 16
144143 far = 2.5 * 16
145144 # scene.fog = new THREE.Fog color, near, far
146- gui .add ( @params , ' fog' ).name ( ' Enable fog' ).listen ().onChange ()->
145+ gui .add ( @params , " fog" ).name ( " Enable fog" ).listen ().onChange ()->
147146 if _this .params .fog
148147 _this .scene .fog = new THREE.Fog color, near, far
149148 else
150149 _this .scene .fog = null
151- gui .add ( @world .material , ' wireframe' ).name ( ' Wireframe' ).listen ()
152- gui .add ( @params , ' chunkdist' ,0 ,10 ,1 ).name ( ' Render distance' ).listen ()
150+ gui .add ( @world .material , " wireframe" ).name ( " Wireframe" ).listen ()
151+ gui .add ( @params , " chunkdist" ,0 ,10 ,1 ).name ( " Render distance" ).listen ()
153152 @mouse = false
154153 $ (document ).mousedown (e)->
155154 if e .which is 1
0 commit comments