Skip to content

Instantly share code, notes, and snippets.

@hoetmaaiers
Last active February 23, 2016 16:45
Show Gist options
  • Save hoetmaaiers/b753f662d4b66fba00f7 to your computer and use it in GitHub Desktop.
Save hoetmaaiers/b753f662d4b66fba00f7 to your computer and use it in GitHub Desktop.

Import solution

custom-levels/my-level.js

/**
 * Create your level from these building blocks:
 *
 * Legende:
 *   @ = Player start position
 *   o = Coins
 *   x = Solid surfaces
 *   ! = Non-moving lava
 *   = = Vertical moving lava
 *   v = Dripping lava
 *   | = Horizontal moving lava
 */

export default [
  "                                                                                ",
  " o                                                                              ",
  " o                                                                              ",
  " o                                                                              ",
  " o                                                                              ",
  "                                                                   @            ",
  "           xxxxxx                                                 xxx           ",
  "                                                   xx      xx    xx!xx          ",
  "                         x          o o      xx                  x!!!x          ",
  "                                                                 xx!xx          ",
  "                                   xxxxx                          xvx           ",
  "                     xxx                                                    xx  ",
  "  xx                                      o o                                x  ",
  "  x                     o                                                    x  ",
  "  x                                      xxxxx                             o x  ",
  "  x          xxxx       o                                                    x  ",
  "  x          x  x                                                xxxxx       x  ",
  "  xxxxxxxxxxxx  xxxxxxxxxxxxxxx   xxxxxxxxxxxxxxxxxxxx     xxxxxxx   xxxxxxxxx  ",
  "                              x   x                  x     x                    ",
  "                              x!!!x                  x!!!!!x                    ",
  "                              x!!!x                  x!!!!!x                    ",
  "                              xxxxx                  xxxxxxx                    ",
  "                                                                                ",
  "                                                                                "
];

app.js

import myLevel from './custom-levels/my-level';

const levels = [simpleLevel];
const game = new Game();
game.run(levels, DOMDisplay);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment