caa-game/src/levels/1-3.js

61 lines
1.7 KiB
JavaScript

const tileSize = 32;
const text = require(__dirname + "/../../res/lang/default.js");
const TextBox = require(__dirname + "/../helpers/textbox.js");
let level = {
tiles: [
1, 2, 2, 2, 2, 2, 2, 2, 5, 6,
4, 21, 22, 23, 21, 22, 23, 21, 22, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
14, 15, 11, 11, 11, 11, 11, 11, 10, 13
],
size: {
w: 10 * tileSize,
h: 20 * tileSize
},
startPos: [
{ x: 5 * tileSize, y: 3 * tileSize }
],
entities: [
{
type: "Mage",
pos: { x: 4.5 * tileSize, y: 10 * tileSize }
},
{
type: "Chest",
pos: { x: 4.5 * tileSize, y: 17 * tileSize },
action: (player, level) => {
level.textbox.add(new TextBox(text.game.keyFind));
player.items.keys.push("1-4");
}
},
{
type: "Portal",
pos: { x: 5 * tileSize, y: 1 * tileSize },
texture: "Door_n",
action: (_player, level) => {
level.switch = { module: __dirname + "/1-2.js", pos: 1 };
},
key: ""
}
]
};
module.exports = level;