summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2021-08-08 21:51:04 +0200
committerAki <please@ignore.pl>2021-08-08 21:51:04 +0200
commit9bea4a8e86f98288abb0d37143159247ce91d708 (patch)
tree622ab95dd83df75f5b8cf2bdbd76fed4043bb115
parent3b3519105707985544f7345961b0286a6123cb30 (diff)
downloadderelict-prototype-master.zip
derelict-prototype-master.tar.gz
derelict-prototype-master.tar.bz2
Cleaned up Battle instance nameHEADmaster
-rw-r--r--derelict.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/derelict.js b/derelict.js
index 9bd77bf..aa4d891 100644
--- a/derelict.js
+++ b/derelict.js
@@ -330,15 +330,15 @@ function averagePosition(positions) {
}
function processBattle({snapshot, renderer, renderer2d, container, toolbar, skybox}) {
- const battle_obj = new Battle({container, renderer, renderer2d})
+ const battle = new Battle({container, renderer, renderer2d})
const wrecks = snapshot.getKillmails().map(killmail => new Wreck({killmail, snapshot}))
wrecks.forEach(wreck => wreck.killmail.victim.position = vec3FromXYZ(wreck.killmail.victim.position))
- wrecks.forEach(wreck => battle_obj.add(wreck))
- battle_obj.grids.forEach(grid => window.addEventListener('resize', () => grid.onresize()))
- battle_obj.grids.forEach(grid => grid.recenter())
+ wrecks.forEach(wreck => battle.add(wreck))
+ battle.grids.forEach(grid => window.addEventListener('resize', () => grid.onresize()))
+ battle.grids.forEach(grid => grid.recenter())
const gridSelection = document.getElementById("grid")
- battle_obj.grids.forEach(grid => {
+ battle.grids.forEach(grid => {
const option = document.createElement("option")
const origin = new THREE.Vector3()
origin.copy(grid.wrecks[0].killmail.victim.position)
@@ -347,22 +347,22 @@ function processBattle({snapshot, renderer, renderer2d, container, toolbar, skyb
gridSelection.appendChild(option)
})
gridSelection.oninput = () => {
- battle_obj.grids.forEach(g => g.disable())
- battle_obj.grids.at(gridSelection.selectedIndex).enable()
- battle_obj.grids.at(gridSelection.selectedIndex).draw()
+ battle.grids.forEach(g => g.disable())
+ battle.grids.at(gridSelection.selectedIndex).enable()
+ battle.grids.at(gridSelection.selectedIndex).draw()
}
gridSelection.oninput()
skybox.then(skybox => {
const rt = new THREE.WebGLCubeRenderTarget(skybox.image.height)
rt.fromEquirectangularTexture(renderer, skybox)
- battle_obj.grids.forEach(g => g.scene.background = rt)
+ battle.grids.forEach(g => g.scene.background = rt)
})
- const statusBar = new StatusBar(battle_obj.timeline)
+ const statusBar = new StatusBar(battle.timeline)
container.appendChild(statusBar.domElement)
- battle_obj.timeline.update()
+ battle.timeline.update()
}
export function init({id, container, toolbar}) {