Coder Social home page Coder Social logo

Comments (7)

dengr1065 avatar dengr1065 commented on May 8, 2024

stacker: counterintuitive, but technically not a bug. will be changed soon
cutter: there's an empty layer behind! it will be brought to bottom one.

from shapez.io.

tobspr avatar tobspr commented on May 8, 2024

What @dengr1065 said. Will soon be obsolete

from shapez.io.

cyantree avatar cyantree commented on May 8, 2024

Will the cutter part be obsolete too? If not, I've prepared a possible fix for it. I can also create a PR if wanted.

shape_definition.js

    cloneFilteredByQuadrants(includeQuadrants) {
        const newLayers = this.internalCloneLayers();
        let lastNonEmptyLayer = -1;
        for (let layerIndex = 0; layerIndex < newLayers.length; ++layerIndex) {
            const quadrants = newLayers[layerIndex];
            let anyContents = false;
            for (let quadrantIndex = 0; quadrantIndex < 4; ++quadrantIndex) {
                if (includeQuadrants.indexOf(quadrantIndex) < 0) {
                    quadrants[quadrantIndex] = null;
                } else if (quadrants[quadrantIndex]) {
                    lastNonEmptyLayer = layerIndex;
                }
            }
        }

        // Remove top most empty layers which aren't needed anymore
        if (lastNonEmptyLayer !== newLayers.length - 1) {
            newLayers.splice(lastNonEmptyLayer + 1);
        }

        return new ShapeDefinition({ layers: newLayers });
    }

This works by not removing every empty layer but only the top most empty ones.

from shapez.io.

LeeSaferite avatar LeeSaferite commented on May 8, 2024

@dengr1065 @tobspr

stacker: counterintuitive, but technically not a bug. will be changed soon

Out of curiosity, regardless of things being changed soon, why would this be considered normal behavior?

from shapez.io.

dengr1065 avatar dengr1065 commented on May 8, 2024

stacker stacks per-layer, it's too hard to implement such logic accidentally 🙂

from shapez.io.

LeeSaferite avatar LeeSaferite commented on May 8, 2024

So it's not simply stacking the full shape from the right on top of the shape from the left and instead it's stacking each quadrant from the right on the quadrant from the left?

from shapez.io.

dengr1065 avatar dengr1065 commented on May 8, 2024

it "moves/stacks" one layer from right shape on the left one, checking whether they can flatten

from shapez.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.