Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
brezende opened this issue Apr 19, 2016 · 0 comments
Open

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

brezende opened this issue Apr 19, 2016 · 0 comments

Comments

@brezende
Copy link
Collaborator

brezende commented Apr 19, 2016

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.

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

No branches or pull requests

3 participants