Updated assets

Doubled the size of the tiles (tilemap.png, tilemap.min.js, level.js).
Doubled the size of the player (player.js).
Added the source files of the tilemap (res/aseprite).
This commit is contained in:
corner 2020-03-25 17:06:26 +01:00
parent ae4d53dc9a
commit 1bb9448408
7 changed files with 20 additions and 13 deletions

3
.gitignore vendored
View File

@ -1,3 +1,4 @@
node_modules
._*
.DS_Store
.DS_Store
res/tilemap.js

Binary file not shown.

Binary file not shown.

10
res/tilemap.min.js vendored
View File

@ -18,7 +18,7 @@
* 13. Corner bottom -> left
* 14. Bottom wall piece before 13.
* 15. Corner left -> bottom
* 16. Normal floor tile
* 32. Normal floor tile
* 17. +-shaped floor tile
* 18. Heavily cracked floor tile
* 19. Lightly cracked floor tile
@ -34,9 +34,13 @@
* 29. heavy vines brick wall 1
* 30. heavy vines brick wall 2
* 31. heavy vines brick wall 3
* 32. Chest closed
* 64. Chest closed
* 33. Chest opened
* 34. Rock 1
* 35. Rock 2
* 36. door
* 37. Ladder (should be over wall)
* 38. Torch
* 39. Staircase
------------------------------------------------------------------- */
module.exports=[{x:0,y:0,walkable:!1},{x:16,y:0,walkable:!1},{x:32,y:0,walkable:!1},{x:48,y:0,walkable:!1},{x:64,y:0,walkable:!1},{x:0,y:16,walkable:!1},{x:16,y:16,walkable:!1},{x:32,y:16,walkable:!1},{x:48,y:16,walkable:!1},{x:64,y:16,walkable:!1},{x:0,y:32,walkable:!1},{x:16,y:32,walkable:!1},{x:32,y:32,walkable:!1},{x:48,y:32,walkable:!1},{x:64,y:32,walkable:!1},{x:0,y:48,walkable:!1},{x:16,y:48,walkable:!0},{x:32,y:48,walkable:!0},{x:48,y:48,walkable:!0},{x:64,y:48,walkable:!0},{x:0,y:64,walkable:!1},{x:16,y:64,walkable:!1},{x:32,y:64,walkable:!1},{x:48,y:64,walkable:!1},{x:64,y:64,walkable:!1},{x:0,y:80,walkable:!1},{x:16,y:80,walkable:!1},{x:32,y:80,walkable:!1},{x:48,y:80,walkable:!1},{x:64,y:80,walkable:!1},{x:0,y:96,walkable:!1},{x:16,y:96,walkable:!1},{x:32,y:96,walkable:!1},{x:48,y:96,walkable:!1},{x:64,y:96,walkable:!1},{x:0,y:112,walkable:!1}];
module.exports=[{x:0,y:0,walkable:!1},{x:32,y:0,walkable:!1},{x:64,y:0,walkable:!1},{x:96,y:0,walkable:!1},{x:128,y:0,walkable:!1},{x:0,y:32,walkable:!1},{x:32,y:32,walkable:!1},{x:64,y:32,walkable:!1},{x:96,y:32,walkable:!1},{x:128,y:32,walkable:!1},{x:0,y:64,walkable:!1},{x:32,y:64,walkable:!1},{x:64,y:64,walkable:!1},{x:96,y:64,walkable:!1},{x:128,y:64,walkable:!1},{x:0,y:96,walkable:!1},{x:32,y:96,walkable:!0},{x:64,y:96,walkable:!0},{x:96,y:96,walkable:!0},{x:128,y:96,walkable:!0},{x:0,y:128,walkable:!1},{x:32,y:128,walkable:!1},{x:64,y:128,walkable:!1},{x:96,y:128,walkable:!1},{x:128,y:128,walkable:!1},{x:0,y:80,walkable:!1},{x:32,y:80,walkable:!1},{x:64,y:80,walkable:!1},{x:96,y:80,walkable:!1},{x:128,y:80,walkable:!1},{x:0,y:96,walkable:!1},{x:32,y:96,walkable:!1},{x:64,y:96,walkable:!1},{x:96,y:96,walkable:!1},{x:128,y:96,walkable:!1},{x:0,y:224,walkable:!1},{x:32,y:224,walkable:!1},{x:64,y:224,walkable:!1},{x:96,y:224,walkable:!1},{x:128,y:224,walkable:!1}];

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -6,7 +6,7 @@ var texture = new Texture("./res/player.png");
class Player extends TileSprite {
constructor(keys, window, level) {
super(texture, 24, 24);
this.scale = { x: 1, y: 1 };
this.scale = { x: 2, y: 2 };
this.window = window;
@ -41,8 +41,8 @@ class Player extends TileSprite {
this.hitBox = {
x: 4,
y: 0,
w: 15,
h: 24
w: 30,
h: 48
};
}

View File

@ -4,10 +4,12 @@ const { Texture, TileMap } = asdf;
const texture = new Texture("./res/tilemap.png");
const tiles = require("../../res/tilemap.min.js");
const levelSize = { w: 480, h: 240 };
const tileSize = 32;
const levelSize = { w: 960, h: 480 };
var levelData = [
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5,
3, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 6,
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 5,
3, 20, 21, 22, 20, 21, 22, 20, 21, 22, 20, 21, 22, 20, 21, 22, 20, 21, 22, 20, 21, 22, 20, 21, 22, 20, 21, 22, 20, 6,
3, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 6,
3, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 6,
3, 16, 16, 16, 16, 20, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 6,
@ -20,16 +22,16 @@ var levelData = [
3, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 6,
3, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 6,
3, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 6,
13, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 8
13, 14, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 8
];
var levelTiles = levelData.map(function(e) {
return { x: (tiles[e].x / 16), y: (tiles[e].y / 16), walkable: tiles[e].walkable };
return { x: (tiles[e].x / tileSize), y: (tiles[e].y / tileSize), walkable: tiles[e].walkable };
});
class Level extends TileMap {
constructor () {
super(levelTiles, levelSize.w / 16, levelSize.h / 16, 16, 16, texture);
super(levelTiles, levelSize.w / tileSize, levelSize.h / tileSize, tileSize, tileSize, texture);
this.pos = { x: 0, y: 0 };
this.scale = { x: 1, y: 1 };
this.w = levelSize.w;