[levels]: Added decorations to all levels

This commit is contained in:
Job Vonk 2020-04-17 20:43:17 +02:00
parent fb323809bc
commit 662f7b8485
22 changed files with 272 additions and 152 deletions

View File

@ -20,7 +20,7 @@ function createWindow () {
}
});
ipcMain.on("resize", function (event, window) {
ipcMain.on("resize", (_event, window) => {
win.setSize( window.w, window.h);
});
@ -31,7 +31,7 @@ function createWindow () {
win.loadFile(path.join("html/game.html"));
// Open the DevTools.
win.webContents.openDevTools();
if (process.env.NODE_ENV === "dev") win.webContents.openDevTools();
}
// This method will be called when Electron has finished

49
package-lock.json generated
View File

@ -427,6 +427,12 @@
"fill-range": "^7.0.1"
}
},
"buffer-crc32": {
"version": "0.2.13",
"resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
"integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=",
"dev": true
},
"buffer-from": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
@ -1290,15 +1296,15 @@
}
},
"extract-zip": {
"version": "1.6.7",
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz",
"integrity": "sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=",
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.7.0.tgz",
"integrity": "sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==",
"dev": true,
"requires": {
"concat-stream": "1.6.2",
"debug": "2.6.9",
"mkdirp": "0.5.1",
"yauzl": "2.4.1"
"concat-stream": "^1.6.2",
"debug": "^2.6.9",
"mkdirp": "^0.5.4",
"yauzl": "^2.10.0"
},
"dependencies": {
"debug": {
@ -1337,9 +1343,9 @@
"dev": true
},
"fd-slicer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz",
"integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz",
"integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=",
"dev": true,
"requires": {
"pend": "~1.2.0"
@ -1992,18 +1998,18 @@
}
},
"minimist": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
"dev": true
},
"mkdirp": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
"integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
"dev": true,
"requires": {
"minimist": "0.0.8"
"minimist": "^1.2.5"
}
},
"ms": {
@ -3146,12 +3152,13 @@
}
},
"yauzl": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz",
"integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=",
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz",
"integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=",
"dev": true,
"requires": {
"fd-slicer": "~1.0.1"
"buffer-crc32": "~0.2.3",
"fd-slicer": "~1.1.0"
}
}
}

View File

@ -26,7 +26,9 @@ module.exports = {
keyMissing: "You do not have the key for this door!",
lifeBoost: "You found some health replenishing food!",
signs: {
"2-2": "Many secrets to the left",
"1-1": "Try opening the chest with the spacebar.",
"1-2": "Always be careful opening doors.",
"2-2": "Secret door on the right",
"2-6": "Impressive, you're good.",
"3-1": "Climb the ladder and walk two tiles to the left",
"3-4": "Congrats."

View File

@ -190,52 +190,52 @@ module.exports = [
},
{
x: 0,
y: 80,
y: 160,
walkable: false
},
{
x: 32,
y: 80,
y: 160,
walkable: false
},
{
x: 64,
y: 80,
y: 160,
walkable: false
},
{
x: 96,
y: 80,
y: 160,
walkable: false
},
{
x: 128,
y: 80,
y: 160,
walkable: false
},
{
x: 0,
y: 96,
y: 192,
walkable: false
},
{
x: 32,
y: 96,
y: 192,
walkable: false
},
{
x: 64,
y: 96,
y: 192,
walkable: false
},
{
x: 96,
y: 96,
y: 192,
walkable: false
},
{
x: 128,
y: 96,
y: 192,
walkable: false
},
{

28
src/entities/rock.js Normal file
View File

@ -0,0 +1,28 @@
var asdf = require("asdf-games");
// eslint-disable-next-line no-unused-vars
const { Texture, TileSprite } = asdf;
const texture = new Texture(__dirname + "/../../res/images/tilemap.png");
class Rock extends TileSprite {
constructor(pos, type) {
super(texture, 32, 32);
this.pos = pos;
this.scale = { x: 1, y: 1 };
this.frame = type === "Big" ? { x: 0, y: 7 } : { x: 4, y: 6};
this.hitBox = {
x: 1,
y: 1,
w: 28,
h: 28
};
}
update(dt) {
super.update(dt);
}
}
module.exports = Rock;

View File

@ -10,6 +10,7 @@ const Mage = require("../entities/mage.js");
const Chest = require("../entities/chest.js");
const Portal = require("../entities/portal.js");
const Sign = require("../entities/sign.js");
const Rock = require("../entities/rock.js");
// const sounds = {
// bg: new Sound(__dirname + "/../../res/sounds/bg.wav", { volume: 0.05, loop: true })
@ -53,6 +54,9 @@ class Level extends TileMap {
case "Sign":
e.entity = new Sign({ x: e.pos.x / 1, y: e.pos.y / 1 }, this.player, this.keys, this, e.text);
break;
case "Rock":
e.entity = new Rock({ x: e.pos.x / 1, y: e.pos.y / 1 }, e.texture);
break;
}
this.children.push(e.entity);
}

View File

@ -3,13 +3,13 @@ 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, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 7,
4, 21, 22, 23, 21, 28, 32, 30, 7,
4, 17, 20, 17, 19, 18, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 7,
4, 18, 20, 17, 17, 19, 17, 19, 7,
4, 17, 17, 17, 20, 17, 18, 18, 7,
4, 20, 17, 18, 17, 17, 17, 17, 7,
4, 19, 17, 17, 17, 20, 17, 17, 7,
14, 15, 11, 11, 11, 11, 11, 10, 13,
],
size: {

View File

@ -6,18 +6,18 @@ 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,
4, 21, 22, 23, 21, 22, 26, 24, 25, 23, 21, 22, 23, 21, 7,
4, 18, 17, 20, 18, 17, 17, 19, 17, 17, 17, 19, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 20, 17, 17, 17, 18, 7,
4, 19, 17, 20, 17, 17, 17, 18, 17, 17, 17, 17, 17, 17, 7,
4, 20, 17, 17, 17, 20, 19, 17, 17, 18, 17, 20, 17, 17, 7,
4, 17, 17, 17, 19, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 18, 17, 17, 17, 17, 17, 20, 17, 17, 17, 19, 17, 7,
4, 20, 17, 17, 18, 17, 19, 20, 17, 17, 17, 18, 17, 18, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 20, 17, 20, 17, 17, 7,
4, 17, 17, 17, 19, 17, 17, 20, 17, 17, 17, 17, 17, 17, 7,
4, 17, 18, 17, 17, 17, 17, 17, 17, 17, 18, 19, 17, 17, 7,
4, 20, 17, 17, 19, 20, 17, 18, 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
],
@ -65,7 +65,25 @@ let level = {
{
type: "Mage",
pos: { x: 7 * tileSize, y: 7 * tileSize }
}
},
{
type: "Rock",
pos: { x: 13 * tileSize, y: 9 * tileSize }
},
{
type: "Rock",
pos: { x: tileSize, y: 12 * tileSize },
texture: "Big"
},
{
type: "Rock",
pos: { x: 13 * tileSize, y: 4 * tileSize },
texture: "Big"
},
{
type: "Rock",
pos: { x: tileSize, y: 17 * tileSize }
},
]
};

View File

@ -7,9 +7,9 @@ let level = {
tiles: [
1, 2, 2, 5, 6,
4, 21, 22, 23, 7,
4, 17, 17, 17, 7,
4, 17, 17, 17, 7,
4, 17, 17, 17, 7,
4, 17, 17, 19, 7,
4, 20, 17, 17, 7,
4, 17, 18, 17, 7,
14, 16, 18, 12, 13,
0, 14, 50, 13, 0,
],
@ -23,12 +23,17 @@ let level = {
entities: [
{
type: "Chest",
pos: { x: 2 * tileSize, y: 2 * tileSize },
pos: { x: tileSize, y: 2 * tileSize },
action: (player, level) => {
level.textbox.add(new TextBox(text.game.keyFind));
player.items.keys.push("1-1_1");
}
},
{
type: "Sign",
pos: { x: 3 * tileSize, y: tileSize },
text: text.game.signs["1-1"]
},
{
type: "Portal",
pos: { x: 2 * tileSize, y: 5 * tileSize },

View File

@ -1,30 +1,30 @@
const tileSize = 32;
const text = require(__dirname + "/../../res/lang/default.js");
let level = {
tiles: [
1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 6,
4, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 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, 17, 17, 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, 17, 17, 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, 17, 17, 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, 17, 17, 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, 17, 17, 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, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 21, 22, 23, 21, 22, 23, 27, 28, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 27, 28, 23, 21, 7,
4, 17, 17, 17, 17, 17, 17, 19, 17, 17, 19, 17, 20, 17, 17, 17, 17, 17, 17, 17, 18, 17, 17, 20, 17, 17, 17, 17, 17, 7,
4, 17, 18, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 20, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 20, 17, 7,
4, 17, 17, 17, 17, 18, 17, 17, 17, 20, 17, 18, 17, 17, 19, 17, 17, 17, 17, 17, 19, 17, 17, 17, 17, 17, 17, 17, 18, 7,
14, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 16, 47, 12, 11, 11, 10, 13,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 50, 13, 0, 0, 0, 0,
],
size: {
w: 30 * tileSize,
h: 10 * tileSize
h: 7 * tileSize
},
startPos: [
{ x: 5 * tileSize, y: 3 * tileSize },
{ x: 24 * tileSize, y: 6 * tileSize }
{ x: 24 * tileSize, y: 4 * tileSize },
{ x: 24 * tileSize, y: 3 * tileSize },
],
entities: [
{
type: "Portal",
pos: { x: 5 * tileSize, y: 1 * tileSize },
pos: { x: 5 * tileSize, y: tileSize },
texture: "Door_n",
action: (_player, level) => {
level.switch = { module: __dirname + "/1-1.js", pos: 0 };
@ -33,7 +33,7 @@ let level = {
},
{
type: "Portal",
pos: { x: 24 * tileSize, y: 1 * tileSize },
pos: { x: 24 * tileSize, y: tileSize },
texture: "Door_n",
action: (_player, level) => {
level.switch = { module: __dirname + "/1-4.js", pos: 0 };
@ -42,12 +42,22 @@ let level = {
},
{
type: "Portal",
pos: { x: 24 * tileSize, y: 8 * tileSize },
pos: { x: 24 * tileSize, y: 5 * tileSize },
texture: "Door_s",
action: (_player, level) => {
level.switch = { module: __dirname + "/1-3.js", pos: 0 };
},
key: ""
},
{
type: "Sign",
pos: { x: 22 * tileSize, y: tileSize },
text: text.game.signs["1-2"]
},
{
type: "Rock",
pos: { x: 15 * tileSize, y: 2 * tileSize },
texture: "Big"
}
]
};

View File

@ -6,24 +6,24 @@ 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, 21, 28, 32, 30, 22, 32, 21, 22, 7,
4, 17, 17, 17, 17, 19, 17, 17, 20, 7,
4, 17, 18, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 19, 17, 7,
4, 17, 17, 17, 17, 17, 18, 17, 17, 7,
4, 17, 20, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 18, 17, 19, 17, 20, 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, 20, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 18, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 20, 17, 7,
4, 19, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 18, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 19, 17, 18, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 20, 17, 17, 18, 17, 17, 17, 17, 7,
14, 15, 11, 11, 11, 11, 11, 11, 10, 13
],
size: {
@ -48,12 +48,32 @@ let level = {
},
{
type: "Portal",
pos: { x: 5 * tileSize, y: 1 * tileSize },
pos: { x: 5 * tileSize, y: tileSize },
texture: "Door_n",
action: (_player, level) => {
level.switch = { module: __dirname + "/1-2.js", pos: 1 };
},
key: ""
},
{
type: "Rock",
pos: { x: 4 * tileSize, y: 2 * tileSize },
texture: "Big"
},
{
type: "Rock",
pos: { x: 6 * tileSize, y: 2 * tileSize },
texture: "Small"
},
{
type: "Rock",
pos: { x: tileSize, y: 13 * tileSize },
texture: "Big"
},
{
type: "Rock",
pos: { x: 8 * tileSize, y: 6 * tileSize },
texture: "Big"
}
]
};

View File

@ -3,13 +3,13 @@ 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, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 7,
4, 21, 25, 23, 21, 28, 29, 27, 7,
4, 18, 20, 17, 17, 17, 17, 18, 7,
4, 17, 17, 19, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 20, 17, 17, 7,
4, 17, 20, 17, 17, 17, 19, 17, 7,
4, 17, 18, 17, 17, 17, 17, 20, 7,
4, 17, 17, 17, 17, 17, 19, 17, 7,
14, 15, 11, 16, 47, 12, 11, 10, 13,
0, 0, 0, 14, 50, 13, 0, 0, 0, 0,
],
@ -18,7 +18,7 @@ let level = {
h: 10 * tileSize
},
startPos: [
{ x: 5 * tileSize, y: 3 * tileSize }
{ x: 4 * tileSize, y: 6 * tileSize }
],
entities: [
{
@ -26,7 +26,7 @@ let level = {
pos: { x: 4 * tileSize, y: 8 * tileSize },
texture: "Door_s",
action: (_player, level) => {
level.switch = { module: __dirname + "/1-2.js", pos: 1 };
level.switch = { module: __dirname + "/1-2.js", pos: 2 };
},
key: ""
},
@ -38,6 +38,15 @@ let level = {
level.switch = { module: __dirname + "/2-1.js", pos: 0 };
},
key: "1-4"
},
{
type: "Rock",
pos: { x: 7 * tileSize, y: 7 * tileSize },
},
{
type: "Rock",
pos: { x: tileSize, y: 2 * tileSize },
texture: "Big"
}
]
};

View File

@ -4,12 +4,12 @@ let level = {
tiles: [
1, 2, 2, 2, 2, 2, 2, 2, 6,
4, 21, 22, 23, 21, 22, 23, 21, 7,
4, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 51, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 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,
],
@ -38,7 +38,16 @@ let 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"
},
]
};

View File

@ -6,10 +6,10 @@ const TextBox = require(__dirname + "/../helpers/textbox.js");
let level = {
tiles: [
1, 52, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 6,
4, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 7,
4, 17, 17, 17, 17, 17, 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, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 30, 28, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 28, 32, 7,
4, 18, 17, 17, 19, 20, 17, 17, 17, 17, 18, 17, 17, 17, 18, 17, 17, 19, 17, 7,
4, 17, 17, 20, 17, 17, 17, 18, 17, 17, 17, 19, 17, 17, 17, 17, 20, 17, 17, 7,
4, 17, 19, 17, 18, 17, 17, 17, 17, 19, 17, 17, 20, 17, 19, 17, 17, 17, 18, 7,
14, 48, 47, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 16, 47, 12, 11, 10, 13,
0, 14, 50, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 50, 13, 0, 0, 0, 0,
],

View File

@ -6,14 +6,14 @@ const TextBox = require(__dirname + "/../helpers/textbox.js");
let level = {
tiles: [
1, 2, 5, 2, 5, 2, 5, 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, 24, 25, 23, 21, 22, 23, 27, 31, 7,
4, 17, 17, 17, 17, 17, 19, 17, 17, 7,
4, 18, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 20, 17, 18, 17, 20, 17, 17, 7,
4, 19, 17, 17, 17, 17, 17, 17, 18, 7,
4, 17, 17, 20, 17, 17, 19, 17, 17, 7,
4, 17, 18, 17, 17, 17, 17, 17, 19, 7,
4, 19, 17, 17, 20, 17, 17, 17, 17, 7,
14, 11, 11, 11, 11, 11, 16, 47, 49, 13,
0, 0, 0, 0, 0, 0, 14, 50, 13, 0, 0,
],

View File

@ -6,11 +6,11 @@ const TextBox = require(__dirname + "/../helpers/textbox.js");
let level = {
tiles: [
1, 2, 5, 2, 5, 2, 5, 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, 24, 22, 23, 21, 22, 23, 21, 25, 7,
4, 20, 17, 17, 17, 19, 17, 17, 17, 7,
4, 18, 17, 19, 20, 17, 17, 17, 20, 7,
4, 17, 17, 17, 17, 17, 17, 18, 17, 7,
4, 17, 18, 17, 20, 17, 17, 17, 19, 7,
14, 11, 11, 11, 11, 11, 11, 11, 11, 13,
],
size: {

View File

@ -3,11 +3,11 @@ const tileSize = 32;
let level = {
tiles: [
1, 2, 5, 2, 5, 2, 5, 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, 21, 22, 23, 21, 22, 26, 21, 25, 7,
4, 18, 17, 20, 17, 17, 17, 17, 19, 7,
4, 19, 17, 17, 20, 19, 18, 17, 17, 7,
4, 20, 17, 17, 17, 17, 17, 17, 20, 7,
4, 17, 18, 17, 19, 17, 17, 20, 18, 7,
14, 11, 11, 11, 11, 11, 11, 11, 11, 13,
],
size: {

View File

@ -5,13 +5,13 @@ const text = require(__dirname + "/../../res/lang/default.js");
let level = {
tiles: [
1, 2, 2, 2, 2, 2, 2, 2, 6,
4, 21, 22, 23, 21, 22, 23, 21, 7,
4, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 51, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 17, 17, 17, 17, 17, 17, 7,
4, 21, 22, 23, 21, 22, 29, 30, 7,
4, 18, 17, 20, 17, 19, 17, 18, 7,
4, 19, 17, 17, 51, 17, 17, 17, 7,
4, 19, 17, 17, 17, 20, 17, 17, 7,
4, 17, 18, 17, 17, 18, 17, 20, 7,
4, 17, 20, 17, 17, 17, 18, 19, 7,
4, 19, 18, 17, 20, 17, 17, 17, 7,
14, 15, 11, 16, 47, 12, 11, 10, 13,
0, 0, 0, 14, 50, 13, 0, 0, 0, 0,
],
@ -45,7 +45,15 @@ let level = {
type: "Sign",
pos: { x: 3 * tileSize, y: tileSize },
text: text.game.signs["2-6"]
}
},
{
type: "Rock",
pos: { x: tileSize, y: 6 * tileSize }
},
{
type: "Rock",
pos: { x: 2 * tileSize, y: 7 * tileSize }
},
]
};

View File

@ -5,23 +5,23 @@ const text = require(__dirname + "/../../res/lang/default.js");
let level = {
tiles: [
0, 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 0, 0, 0, 0, 0, 0,
1, 52, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 17, 17, 17, 7, 0, 0, 0, 0, 0, 0, 0, 0,
4, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 17, 17, 17, 7, 0, 0, 0, 0, 0, 0, 0, 0,
4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, 0, 0, 0, 0, 0, 0, 0, 0,
4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, 0, 0, 0, 0, 0, 0, 0, 0,
4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, 0, 0, 0, 0, 0, 0, 0, 0,
4, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 29, 27, 28, 32, 30, 31, 32, 17, 17, 17, 7, 0, 0, 0, 0, 0, 0, 0, 0,
4, 18, 17, 17, 17, 19, 17, 18, 17, 17, 20, 18, 17, 17, 20, 17, 17, 17, 18, 17, 17, 7, 0, 0, 0, 0, 0, 0, 0, 0,
4, 20, 17, 17, 20, 17, 17, 17, 19, 17, 17, 19, 17, 20, 17, 17, 18, 17, 17, 17, 19, 7, 0, 0, 0, 0, 0, 0, 0, 0,
4, 17, 19, 17, 17, 18, 17, 17, 20, 17, 17, 17, 17, 17, 19, 17, 17, 17, 20, 17, 17, 7, 0, 0, 0, 0, 0, 0, 0, 0,
14, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 13, 0, 0, 0, 0, 0, 0, 0, 0,
],
size: {

View File

View File

@ -6,14 +6,14 @@ const TextBox = require(__dirname + "/../helpers/textbox.js");
let level = {
tiles: [
1, 2, 5, 2, 5, 2, 5, 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, 21, 22, 23, 21, 22, 23, 24, 25, 7,
4, 19, 18, 17, 17, 19, 17, 17, 18, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 17, 18, 17, 20, 17, 17, 17, 17, 7,
4, 20, 17, 17, 17, 19, 17, 20, 17, 7,
4, 17, 17, 17, 20, 17, 17, 17, 19, 7,
4, 17, 17, 17, 17, 17, 17, 17, 17, 7,
4, 18, 17, 17, 17, 17, 19, 17, 17, 7,
14, 11, 16, 47, 49, 11, 11, 11, 11, 13,
0, 0, 14, 50, 13, 0, 0, 0, 0, 0, 0,
],

View File

@ -2,7 +2,7 @@ const asdf = require("asdf-games");
// eslint-disable-next-line no-unused-vars
const { Container, Camera } = asdf;
const debugMode = true;
const debugMode = false;
const Stats = require(__dirname + "/../helpers/stats.js");
var Player = require(__dirname + "/../entities/player.js");