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

54 lines
1.2 KiB
JavaScript

const tileSize = 32;
let level = {
tiles: [
1, 2, 2, 2, 2, 2, 2, 2, 6,
4, 21, 22, 23, 21, 22, 23, 21, 7,
4, 18, 17, 20, 19, 17, 17, 19, 7,
4, 17, 18, 17, 51, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 20, 17, 7,
4, 17, 19, 20, 17, 18, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 20, 7,
4, 18, 17, 17, 19, 17, 17, 17, 7,
14, 15, 11, 16, 47, 12, 11, 10, 13,
0, 0, 0, 14, 50, 13, 0, 0, 0, 0,
],
size: {
w: 9 * tileSize,
h: 10 * tileSize
},
startPos: [
{ x: 5 * tileSize, y: 3 * tileSize }
],
entities: [
{
type: "Portal",
pos: { x: 4 * tileSize, y: 8 * tileSize },
texture: "Door_s",
action: (_player, level) => {
level.switch = { module: __dirname + "/2-2.js", pos: 0 };
},
key: ""
},
{
type: "Portal",
pos: { x: 4 * tileSize, y: 3 * tileSize },
texture: "Ladder",
action: (_player, level) => {
level.switch = { module: __dirname + "/1-4.js", pos: 0 };
},
key: "1-4"
},
{
type: "Rock",
pos: { x: 3 * tileSize, y: 2 * tileSize },
},
{
type: "Rock",
pos: { x: 6 * tileSize, y: 5 * tileSize },
texture: "Big"
},
]
};
module.exports = level;