Skip to content

Commit

Permalink
Electrician 15: Level 5 (spiders!!!) (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdrzazga authored Dec 28, 2024
1 parent b587bd3 commit 581f4b0
Show file tree
Hide file tree
Showing 5 changed files with 265 additions and 185 deletions.
22 changes: 11 additions & 11 deletions other/electrician/files/classdef.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class Wire {

calculateY(floor1, floor2) {
const y1 = floor1?.sprite.y || 0;
const y2 = floor2 ? floor2.sprite.y : 0;
const y2 = floor2?.sprite.y || 0;
return (y1 + y2) / 2;
}

Expand Down Expand Up @@ -266,7 +266,7 @@ class Enemy {
}
}

class Bat extends Enemy{
class Bat extends Enemy {
static MOVE_RADIUS = 280;

constructor(id){
Expand Down Expand Up @@ -390,39 +390,39 @@ class FloorBuilder {
return this;
}

withCeilingConnector(connectorSlot){
this.floor.ceilingConnectors.push(connectorSlot);
withCeilingConnectors(connectorSlotsArray){
this.floor.ceilingConnectors.push(...connectorSlotsArray);
return this;
}

withBottomConnector(connectorSlot) {
this.floor.bottomConnectors.push(connectorSlot);
withBottomConnectors(connectorSlotsArray) {
this.floor.bottomConnectors.push(...connectorSlotsArray);
return this;
}

withLampInCenter() {
const lampConnectorX = Math.floor(Floor.WIDTH/Wire.SLOT_SIZE /2);
this.withCeilingConnector(lampConnectorX);
this.withCeilingConnectors([lampConnectorX]);
return this;
}

withTVInCenterLeft(){
const tvConnectorX = 12;
this.withBottomConnector(tvConnectorX);
this.withBottomConnectors([tvConnectorX]);
return this;
}

withFridgeOnLeft(){
const fridgeConnectorSlot = 2;
this.withCeilingConnector(fridgeConnectorSlot);
this.withCeilingConnectors([fridgeConnectorSlot]);
return this;
}

withKitchenSegmentOnRight(){
const fridge2ConnectorSlot = 29;
const fanConnectorSlot = 26;
this.withCeilingConnector(fridge2ConnectorSlot);
this.withCeilingConnector(fanConnectorSlot);
this.withCeilingConnectors([fridge2ConnectorSlot]);
this.withCeilingConnectors([fanConnectorSlot]);
return this;
}
}
Expand Down
Loading

0 comments on commit 581f4b0

Please sign in to comment.