Skip to content

Commit 6f1edcc

Browse files
Fixed linting
1 parent e432904 commit 6f1edcc

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/scripts/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Setup } from './Setup.js'
66
import $ from 'jquery'
77

88
class Game {
9-
constructor() {
9+
constructor () {
1010
this.production = window.PRODUCTION
1111
if (this.production) {
1212
console.log('Running in production mode')
@@ -38,7 +38,7 @@ class Game {
3838
this.mouse = false
3939
}
4040

41-
async init() {
41+
async init () {
4242
await this.al.init()
4343
await Setup(this)
4444
this.socket.on('blockUpdate', (block) => {
@@ -127,7 +127,7 @@ class Game {
127127
return this.animate()
128128
}
129129

130-
animate() {
130+
animate () {
131131
if (this.stats) {
132132
this.stats.begin()
133133
this.render()
@@ -140,7 +140,7 @@ class Game {
140140
})
141141
}
142142

143-
render() {
143+
render () {
144144
const width = window.innerWidth
145145
const height = window.innerHeight
146146
if (this.canvas.width !== width || this.canvas.height !== height) {

src/scripts/world/chunk.worker.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import vec3 from 'vec3'
77
self.requestAnimationFrame = raf
88
let terrain = null
99
class TerrainManager {
10-
constructor(data) {
10+
constructor (data) {
1111
this.chunkTerrain = new ChunkTerrain({
1212
blocksDef: data.blocksDef
1313
})
@@ -32,14 +32,14 @@ class TerrainManager {
3232
this.loop()
3333
}
3434

35-
distance(chunkId) {
35+
distance (chunkId) {
3636
const data = this.chunkTerrain.strToVec(chunkId)
3737
const chunk = vec3(...data)
3838
const chunkP = vec3(...this.playerChunk)
3939
return chunkP.distanceTo(chunk)
4040
}
4141

42-
setVoxel(data) {
42+
setVoxel (data) {
4343
this.chunkTerrain.setVoxel(...data)
4444
const chunkId = this.chunkTerrain.vecToStr(
4545
...terrain.chunkTerrain.computeChunkForVoxel(
@@ -62,7 +62,7 @@ class TerrainManager {
6262
}
6363
}
6464

65-
setChunk(data) {
65+
setChunk (data) {
6666
this.chunkTerrain.setChunk(data[0], data[1], data[2], data[3])
6767
const chunkId = terrain.chunkTerrain.vecToStr(
6868
data[0],
@@ -81,7 +81,7 @@ class TerrainManager {
8181
}
8282
}
8383

84-
genNearestChunk() {
84+
genNearestChunk () {
8585
let nearestChunkId = ''
8686
let nearestDistance = -1
8787
let isNearest = false
@@ -111,7 +111,7 @@ class TerrainManager {
111111
}
112112
}
113113

114-
removeChunks() {
114+
removeChunks () {
115115
for (const chunkId in this.generatedChunks) {
116116
const dist = this.distance(chunkId)
117117
if (dist > this.renderRadius) {
@@ -125,15 +125,15 @@ class TerrainManager {
125125
}
126126
}
127127

128-
loop() {
128+
loop () {
129129
this.removeChunks()
130130
this.genNearestChunk()
131131
self.requestAnimationFrame(() => {
132132
this.loop()
133133
})
134134
}
135135

136-
updateChunksAroundPlayer(data) {
136+
updateChunksAroundPlayer (data) {
137137
this.playerChunk = data[0]
138138
this.renderRadius = data[1]
139139
}

0 commit comments

Comments
 (0)