mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Further fixes to the belt placement
This commit is contained in:
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…
Reference in New Issue
Block a user