Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
just1689 committed May 15, 2018
1 parent b65ef6a commit aac4378
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions client/js/controller/BabylonController.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ export class BabylonController {

static setPowerLevel(key, level) {
const p = powerIconInfo
.find(power => power.key == key)
.find(power => power.key === key)
if (p) {
p.level = level
if (level == 1) {
if (level === 1) {
BabylonUI.createBotPowerBarItem(p.powerNumber - 1, p.ico, p.key)
PowerCooldownBar.set(
(p.powerNumber).toString(),
Expand Down
2 changes: 1 addition & 1 deletion client/js/model/Bullet.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class Bullet {
this.bBullet.position.x = +obj.point.x
this.bBullet.position.y = +obj.point.y
this.bBullet.position.z = +obj.point.z
this.bBullet.rotation.y = obj.point.rotation + Math.PI
this.bBullet.rotation.y = +obj.point.rotation + Math.PI

this.tick()
this.tick()
Expand Down
4 changes: 2 additions & 2 deletions client/js/view/BabylonModels.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class BabylonModels {
baby.camera.position.x = +t.point.x
baby.camera.position.y = +t.point.y + 0.25
baby.camera.position.z = +t.point.z
baby.camera.rotation.y = t.point.rotation
baby.camera.rotation.y = +t.point.rotation

//Move the healthbar
// BabylonUI.changeMyHealthBar(t.health, t.maxHealth)
Expand All @@ -24,7 +24,7 @@ export class BabylonModels {
s.position.x = +t.point.x
s.position.y = +t.point.y
s.position.z = +t.point.z
s.rotation.y = t.point.rotation - 1.57
s.rotation.y = +t.point.rotation - 1.57
}
// const rect1 = match.getHealthBarByTag(t.tag)
// if (rect1) {
Expand Down
6 changes: 3 additions & 3 deletions client/js/view/BabylonUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class BabylonUI {
}

static setHealth(t) {
if (match.tag == t.tag) {
if (match.tag === t.tag) {
BabylonUI.changeMyHealthBar(t.health, t.maxHealth)
}

Expand All @@ -40,7 +40,7 @@ export class BabylonUI {

static setHealthRectangle(rect1, health, totalHealth) {
rect1.width = health / totalHealth * 0.2
if (match.miniMapOn != rect1.isVisible) {
if (match.miniMapOn !== rect1.isVisible) {
rect1.isVisible = match.miniMapOn
}

Expand Down Expand Up @@ -279,7 +279,7 @@ export class BabylonUI {
}

static createTinyBlockFromThing(thing) {
if (thing.tag == match.tag) {
if (thing.tag === match.tag) {
BabylonUI.createTinyBlock(thing.point.x, thing.point.z, "blue")
} else {
BabylonUI.createTinyBlock(thing.point.x, thing.point.z, "red")
Expand Down
4 changes: 2 additions & 2 deletions client/js/view/BabylonUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ export class BabylonUtils {

static createMapTile(x, z, skin, model) {
let plane
if (model == "FLAT_TILE") {
if (model === "FLAT_TILE") {
plane = baby.baseTile.clone(("plane" + x) + z)
} else if (model == "ROCK_TILE") {
} else if (model === "ROCK_TILE") {
plane = baby.mountainTile.clone(("plane" + x) + z)
}
plane.position.z = (z * 1)
Expand Down
8 changes: 4 additions & 4 deletions client/js/view/Web.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ export class Web {
}

static changeView(view) {
Web.toggleElement("VIEW_SERVERS", view == "VIEW_SERVERS")
Web.toggleElement("VIEW_GAMES", view == "VIEW_GAMES")
Web.toggleElement("VIEW_CANVAS", view == "VIEW_CANVAS")
if (view == "VIEW_CANVAS") {
Web.toggleElement("VIEW_SERVERS", view === "VIEW_SERVERS")
Web.toggleElement("VIEW_GAMES", view === "VIEW_GAMES")
Web.toggleElement("VIEW_CANVAS", view === "VIEW_CANVAS")
if (view === "VIEW_CANVAS") {
BabylonUtils.setup3D()
}

Expand Down

0 comments on commit aac4378

Please sign in to comment.