()
| 270 | // initialization |
| 271 | |
| 272 | initSurface () { |
| 273 | const webGLSurface = $('canvas#webgl-surface', this.$el) |
| 274 | const normalSurface = $('canvas#normal-surface', this.$el) |
| 275 | this.surface = new Surface(this.world, normalSurface, webGLSurface, { thangTypes: this.supermodel.getModels(ThangType), spectateGame: true, playerNames: this.findPlayerNames(), levelType: this.level.get('type', true) }) |
| 276 | const worldBounds = this.world.getBounds() |
| 277 | const bounds = [{ x: worldBounds.left, y: worldBounds.top }, { x: worldBounds.right, y: worldBounds.bottom }] |
| 278 | this.surface.camera.setBounds(bounds) |
| 279 | const zoom = () => { |
| 280 | return (this.surface != null ? this.surface.camera.zoomTo({ x: (worldBounds.right - worldBounds.left) / 2, y: (worldBounds.top - worldBounds.bottom) / 2 }, 0.1, 0) : undefined) |
| 281 | } |
| 282 | return _.delay(zoom, 4000) // call it later for some reason (TODO: figure this out) |
| 283 | } |
| 284 | |
| 285 | findPlayerNames () { |
| 286 | const playerNames = {} |
no test coverage detected