Further fixes to the belt placement

pull/33/head
Tobias Springer 4 years ago
parent 5a61d1813a
commit 5f3ffd42fd

@ -142,6 +142,8 @@ export class GameCore {
root: this.root,
origin: new Vector(-2, -2),
rotation: 0,
originalRotation: 0,
rotationVariant: 0,
});
}

@ -270,6 +270,7 @@ export class HUDBuildingPlacer extends BaseHUDPart {
origin: tile,
rotation,
rotationVariant,
originalRotation: this.currentBaseRotation,
building: this.currentMetaBuilding.get(),
})
) {

@ -141,10 +141,11 @@ export class GameLogic {
* @param {object} param0
* @param {Vector} param0.origin
* @param {number} param0.rotation
* @param {number} param0.originalRotation
* @param {number} param0.rotationVariant
* @param {MetaBuilding} param0.building
*/
tryPlaceBuilding({ origin, rotation, rotationVariant, building }) {
tryPlaceBuilding({ origin, rotation, rotationVariant, originalRotation, building }) {
if (this.checkCanPlaceBuilding({ origin, rotation, rotationVariant, building })) {
// Remove any removeable entities below
const checker = new StaticMapEntityComponent({
@ -172,6 +173,7 @@ export class GameLogic {
origin,
rotation,
rotationVariant,
originalRotation,
});
return true;
}

@ -102,16 +102,17 @@ export class MetaBuilding {
* @param {GameRoot} param0.root
* @param {Vector} param0.origin Origin tile
* @param {number=} param0.rotation Rotation
* @param {number=} param0.originalRotation Original Rotation
* @param {number=} param0.rotationVariant Rotation variant
*/
createAndPlaceEntity({ root, origin, rotation = 0, rotationVariant = 0 }) {
createAndPlaceEntity({ root, origin, rotation = 0, originalRotation = 0, rotationVariant = 0 }) {
const entity = new Entity(root);
entity.addComponent(
new StaticMapEntityComponent({
spriteKey: "sprites/buildings/" + this.id + ".png",
origin: new Vector(origin.x, origin.y),
rotation,
originalRotation: rotation,
originalRotation,
tileSize: this.getDimensions().copy(),
silhouetteColor: this.getSilhouetteColor(),
})

Loading…
Cancel
Save