New building sprites
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 237 KiB After Width: | Height: | Size: 241 KiB |
Before Width: | Height: | Size: 553 KiB After Width: | Height: | Size: 572 KiB |
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.8 KiB |
|
@ -20,7 +20,7 @@ export class MetaHubBuilding extends MetaBuilding {
|
|||
return "#eb5555";
|
||||
}
|
||||
|
||||
isRotateable() {
|
||||
getIsRotateable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ export class MetaLeverBuilding extends MetaBuilding {
|
|||
return true;
|
||||
}
|
||||
|
||||
isRotateable() {
|
||||
getIsRotateable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,6 +57,11 @@ export class MetaLogicGateBuilding extends MetaBuilding {
|
|||
];
|
||||
}
|
||||
|
||||
getRenderPins() {
|
||||
// We already have it included
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Entity} entity
|
||||
|
|
|
@ -20,7 +20,7 @@ export class MetaTrashBuilding extends MetaBuilding {
|
|||
super("trash");
|
||||
}
|
||||
|
||||
isRotateable(variant) {
|
||||
getIsRotateable(variant) {
|
||||
return variant !== defaultBuildingVariant;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ export class MetaWireTunnelBuilding extends MetaBuilding {
|
|||
return true;
|
||||
}
|
||||
|
||||
isRotateable() {
|
||||
getIsRotateable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ export class MetaBuilding {
|
|||
* @param {string} variant
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isRotateable(variant) {
|
||||
getIsRotateable(variant) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -172,6 +172,14 @@ export class MetaBuilding {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should return false if the pins are already included in the sprite of the building
|
||||
* @returns {boolean}
|
||||
*/
|
||||
getRenderPins() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the entity without placing it
|
||||
* @param {object} param0
|
||||
|
@ -225,7 +233,7 @@ export class MetaBuilding {
|
|||
* @return {{ rotation: number, rotationVariant: number, connectedEntities?: Array<Entity> }}
|
||||
*/
|
||||
computeOptimalDirectionAndRotationVariantAtTile({ root, tile, rotation, variant, layer }) {
|
||||
if (!this.isRotateable(variant)) {
|
||||
if (!this.getIsRotateable(variant)) {
|
||||
return {
|
||||
rotation: 0,
|
||||
rotationVariant: 0,
|
||||
|
|
|
@ -169,26 +169,28 @@ export class WiredPinsSystem extends GameSystemWithFilter {
|
|||
const tile = staticComp.localTileToWorld(slot.pos);
|
||||
|
||||
const worldPos = tile.toWorldSpaceCenterOfTile();
|
||||
|
||||
const effectiveRotation = Math.radians(
|
||||
staticComp.rotation + enumDirectionToAngle[slot.direction]
|
||||
);
|
||||
drawRotatedSprite({
|
||||
parameters,
|
||||
sprite: this.pinSprites[slot.type],
|
||||
x: worldPos.x,
|
||||
y: worldPos.y,
|
||||
angle: effectiveRotation,
|
||||
size: globalConfig.tileSize + 2,
|
||||
offsetX: 0,
|
||||
offsetY: 0,
|
||||
});
|
||||
|
||||
if (staticComp.getMetaBuilding().getRenderPins()) {
|
||||
drawRotatedSprite({
|
||||
parameters,
|
||||
sprite: this.pinSprites[slot.type],
|
||||
x: worldPos.x,
|
||||
y: worldPos.y,
|
||||
angle: effectiveRotation,
|
||||
size: globalConfig.tileSize + 2,
|
||||
offsetX: 0,
|
||||
offsetY: 0,
|
||||
});
|
||||
}
|
||||
|
||||
// Draw contained item to visualize whats emitted
|
||||
const value = slot.value;
|
||||
if (value) {
|
||||
const offset = new Vector(0, -5).rotated(effectiveRotation);
|
||||
value.draw(worldPos.x + offset.x, worldPos.y + offset.y, parameters, 12);
|
||||
const offset = new Vector(0, -9).rotated(effectiveRotation);
|
||||
value.draw(worldPos.x + offset.x, worldPos.y + offset.y, parameters, 9);
|
||||
}
|
||||
|
||||
// Debug view
|
||||
|
|