Skip to content

Create an easy way to add stages to brick breaker #25

Description

@brezende

Something like:
Some files for stages, as the following example:

-- stage1.stg
### ### ### ### ###
### @@@ @@@ @@@ ###
### ### ### ### ###

Those files would describe how blocks should be laid out on the stage. Each three character combination is the code for a different block that should also be specified on a separate file, as in the following example:

//RegularBlock.js
exports.symbol = "###";
exports.type = "Poligon";
exports.transform = function (block) {
        block.draw_colision_area      = false;
        block.solid                   = true;
        block.do_not_colide_with      = ["Border"];
        block.type                    = "Block";
        block.color                   = "#000000";
        block.add_vertice(-13, 0);
        block.add_vertice(12, 0);
        block.add_vertice(12, 15);
        block.add_vertice(-13, 15);
        block.going2destroy = going2destroy;
        block.on_colide_with("ball", function(bola) {});
};

And that should be enough to load the stages.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions