caa-game/src/levels/0-2.js

72 lines
2.1 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, 2, 2, 2, 2, 2, 2, 6,
4, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7,
14, 11, 11, 11, 11, 11, 16, 47, 12, 11, 11, 11, 11, 11, 13,
0, 0, 0, 0, 0, 0, 14, 50, 13, 0, 0, 0, 0, 0, 0, 0
],
size: {
w: 15 * tileSize,
h: 20 * tileSize
},
startPos: [
{ x: 7 * tileSize, y: 12 * tileSize }
],
entities: [
{
type: "Portal",
pos: { x: 7 * tileSize, y: 13 * tileSize },
texture: "Door_s",
action: (_player, level) => {
level.switch = { module: __dirname + "/0-1.js", pos: 0 };
},
key: ""
},
{
type: "Chest",
pos: { x: 7 * tileSize, y: 2 * tileSize },
action: (player, level) => {
level.textbox.add(new TextBox(text.game.keyFind));
player.items.keys.push("3-4");
}
},
{
type: "Mage",
pos: { x: 7 * tileSize, y: 3 * tileSize }
},
{
type: "Mage",
pos: { x: 2 * tileSize, y: 7 * tileSize }
},
{
type: "Mage",
pos: { x: 13 * tileSize, y: 7 * tileSize }
},
{
type: "Mage",
pos: { x: 11 * tileSize, y: 2 * tileSize }
},
{
type: "Mage",
pos: { x: 7 * tileSize, y: 7 * tileSize }
}
]
};
module.exports = level;