1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-16 11:41:50 +00:00

add acceptor/ejector belts to other buildings

This commit is contained in:
EmeraldBlock 2021-11-24 18:03:59 -06:00
parent ec54093fc6
commit fc3de1b586
6 changed files with 26 additions and 4 deletions

View File

@ -8,6 +8,7 @@ import { GameRoot } from "../root";
import { enumHubGoalRewards } from "../tutorial_goals";
import { T } from "../../translations";
import { formatItemsPerSecond, generateMatrixRotations } from "../../core/utils";
import { BELT_BORDER } from "../systems/belt";
/** @enum {string} */
export const enumBalancerVariants = {
@ -183,9 +184,7 @@ export class MetaBalancerBuilding extends MetaBuilding {
? enumDirection.left
: enumDirection.right,
],
// distance to edge of perpendicular belt, ignoring border width
// see generate_belt_sprites.js
beltLength: 23.5 / 192,
beltLength: BELT_BORDER,
},
]);
@ -217,7 +216,7 @@ export class MetaBalancerBuilding extends MetaBuilding {
variant === enumBalancerVariants.splitterInverse
? enumDirection.left
: enumDirection.right,
beltLength: 23.5 / 192,
beltLength: BELT_BORDER,
},
]);

View File

@ -67,71 +67,85 @@ export class MetaHubBuilding extends MetaBuilding {
{
pos: new Vector(0, 0),
directions: [enumDirection.top, enumDirection.left],
beltLength: 0.5,
filter: "shape",
},
{
pos: new Vector(1, 0),
directions: [enumDirection.top],
beltLength: 0.5,
filter: "shape",
},
{
pos: new Vector(2, 0),
directions: [enumDirection.top],
beltLength: 0.5,
filter: "shape",
},
{
pos: new Vector(3, 0),
directions: [enumDirection.top, enumDirection.right],
beltLength: 0.5,
filter: "shape",
},
{
pos: new Vector(0, 3),
directions: [enumDirection.bottom, enumDirection.left],
beltLength: 0.5,
filter: "shape",
},
{
pos: new Vector(1, 3),
directions: [enumDirection.bottom],
beltLength: 0.5,
filter: "shape",
},
{
pos: new Vector(2, 3),
directions: [enumDirection.bottom],
beltLength: 0.5,
filter: "shape",
},
{
pos: new Vector(3, 3),
directions: [enumDirection.bottom, enumDirection.right],
beltLength: 0.5,
filter: "shape",
},
{
pos: new Vector(0, 1),
directions: [enumDirection.left],
beltLength: 0.5,
filter: "shape",
},
{
pos: new Vector(0, 2),
directions: [enumDirection.left],
beltLength: 0.5,
filter: "shape",
},
{
pos: new Vector(0, 3),
directions: [enumDirection.left],
beltLength: 0.5,
filter: "shape",
},
{
pos: new Vector(3, 1),
directions: [enumDirection.right],
beltLength: 0.5,
filter: "shape",
},
{
pos: new Vector(3, 2),
directions: [enumDirection.right],
beltLength: 0.5,
filter: "shape",
},
{
pos: new Vector(3, 3),
directions: [enumDirection.right],
beltLength: 0.5,
filter: "shape",
},
],

View File

@ -65,11 +65,13 @@ export class MetaMixerBuilding extends MetaBuilding {
{
pos: new Vector(0, 0),
directions: [enumDirection.bottom],
beltLength: 0.5,
filter: "color",
},
{
pos: new Vector(1, 0),
directions: [enumDirection.bottom],
beltLength: 0.5,
filter: "color",
},
],

View File

@ -231,6 +231,7 @@ export class MetaPainterBuilding extends MetaBuilding {
{
pos: new Vector(0, 0),
directions: [enumDirection.left],
beltLength: 0.5,
filter: "shape",
},
{

View File

@ -65,11 +65,13 @@ export class MetaStackerBuilding extends MetaBuilding {
{
pos: new Vector(0, 0),
directions: [enumDirection.bottom],
beltLength: 0.5,
filter: "shape",
},
{
pos: new Vector(1, 0),
directions: [enumDirection.bottom],
beltLength: 0.5,
filter: "shape",
},
],

View File

@ -17,6 +17,10 @@ import { defaultBuildingVariant } from "../meta_building";
export const BELT_ANIM_COUNT = 14;
// width of the empty space to the side of the belt sprite, ignoring border width, in tiles
// see generate_belt_sprites.js
export const BELT_BORDER = 23.5 / 192;
const logger = createLogger("belt");
/**