This commit is contained in:
Arne van Iterson 2020-04-06 22:51:58 +02:00
commit 67ffda0154
4 changed files with 255 additions and 50 deletions

1
.gitignore vendored
View File

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

253
res/tilemap.js Normal file
View File

@ -0,0 +1,253 @@
/** -------------------------------------------------------------------
* Tile map for caa-game
* Index for tilemap file
*
* 0. transparent tile
* 1. Corner top-left
* 2. normal top wall middle piece
* 3. Corner top -> left wall
* 4. Left wall
* 5. top wall before corner
* 6. corner top -> right wall
* 7. normal right wall piece
* 8. Corner right -> top
* 9. Corner right -> bottom
* 10. bottom wall piece before 8.
* 11. normal bottom wall piece
* 12. Corner bottom -> right
* 13. Corner right -> bottom
* 14. Corner bottom -> left
* 15. Bottom wall piece before 13.
* 16. Corner left -> bottom
* 17. Normal floor tile
* 18. +-shaped floor tile
* 19. Heavily cracked floor tile
* 20. Lightly cracked floor tile
* 21. Normal brick wall 1
* 22. Normal brick wall 2
* 23. Normal brick wall 3
* 24. blood brick wall 1
* 25. blood brick wall 2
* 26. blood brick wall 3
* 27. light vines brick wall 1
* 28. light vines brick wall 2
* 29. light vines brick wall 3
* 30. heavy vines brick wall 1
* 31. heavy vines brick wall 2
* 32. heavy vines brick wall 3
* 33. Chest closed
* 34. Chest opened
* 35. Rock 1
* 36. Rock 2
* 37. door
* 38. Ladder (should be over wall)
* 39. Torch
* 40. Staircase
------------------------------------------------------------------- */
module.exports = [
{
x: 0,
y: 256,
walkable: false
},
{
x: 0,
y: 0,
walkable: false
},
{
x: 32,
y: 0,
walkable: false
},
{
x: 64,
y: 0,
walkable: false
},
{
x: 96,
y: 0,
walkable: false
},
{
x: 128,
y: 0,
walkable: false
},
{
x: 0,
y: 32,
walkable: false,
},
{
x: 32,
y: 32,
walkable: false,
},
{
x: 64,
y: 32,
walkable: false,
},
{
x: 96,
y: 32,
walkable: false,
},
{
x: 128,
y: 32,
walkable: false,
},
{
x: 0,
y: 64,
walkable: false
},
{
x: 32,
y: 64,
walkable: false
},
{
x: 64,
y: 64,
walkable: false
},
{
x: 96,
y: 64,
walkable: false
},
{
x: 128,
y: 64,
walkable: false
},
{
x: 0,
y: 96,
walkable: false
},
{
x: 32,
y: 96,
walkable: true
},
{
x: 64,
y: 96,
walkable: true
},
{
x: 96,
y: 96,
walkable: true
},
{
x: 128,
y: 96,
walkable: true
},
{
x: 0,
y: 128,
walkable: false
},
{
x: 32,
y: 128,
walkable: false
},
{
x: 64,
y: 128,
walkable: false
},
{
x: 96,
y: 128,
walkable: false
},
{
x: 128,
y: 128,
walkable: false
},
{
x: 0,
y: 80,
walkable: false
},
{
x: 32,
y: 80,
walkable: false
},
{
x: 64,
y: 80,
walkable: false
},
{
x: 96,
y: 80,
walkable: false
},
{
x: 128,
y: 80,
walkable: false
},
{
x: 0,
y: 96,
walkable: false
},
{
x: 32,
y: 96,
walkable: false
},
{
x: 64,
y: 96,
walkable: false
},
{
x: 96,
y: 96,
walkable: false
},
{
x: 128,
y: 96,
walkable: false
},
{
x: 0,
y: 224,
walkable: false
},
{
x: 32,
y: 224,
walkable: false
},
{
x: 64,
y: 224,
walkable: false
},
{
x: 96,
y: 224,
walkable: false
},
{
x: 128,
y: 224,
walkable: false
},
];

47
res/tilemap.min.js vendored
View File

@ -1,47 +0,0 @@
/** -------------------------------------------------------------------
* Tile map for caa-game
* Index for tilemap file
*
* 0. Empty tile
* 1. Corner top-left
* 2. normal top wall middle piece
* 3. Corner top -> left wall
* 4. Left wall
* 5. top wall before corner
* 6. corner top -> right wall
* 7. normal right wall piece
* 8. Corner right -> top
* 9. Corner right -> bottom
* 10. bottom wall piece before 8.
* 12. normal bottom wall piece
* 12. Corner bottom -> right
* 13. Corner right -> bottom
* 14. Corner bottom -> left
* 16. Bottom wall piece before 13.
* 17. Corner left -> bottom
* 33. Normal floor tile
* 18. +-shaped floor tile
* 19. Heavily cracked floor tile
* 20. Lightly cracked floor tile
* 21. Normal brick wall 1
* 22. Normal brick wall 2
* 23. Normal brick wall 3
* 24. blood brick wall 1
* 25. blood brick wall 2
* 26. blood brick wall 3
* 27. light vines brick wall 1
* 28. light vines brick wall 2
* 29. light vines brick wall 3
* 30. heavy vines brick wall 1
* 31. heavy vines brick wall 2
* 32. heavy vines brick wall 3
* 65. Chest closed
* 34. Chest opened
* 35. Rock 1
* 36. Rock 2
* 37. door
* 38. Ladder (should be over wall)
* 39. Torch
* 40. Staircase
------------------------------------------------------------------- */
module.exports=[{x:0,y:256,walkable:!1},{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}];

View File

@ -3,7 +3,7 @@ var asdf = require("asdf-games");
const { Texture, TileMap, entity } = asdf;
const texture = new Texture("./res/tilemap.png");
const tiles = require("../../res/tilemap.min.js");
const tiles = require("../../res/tilemap.js");
const tileSize = 32;
const Mage = require("../entities/mage.js");