diff --git a/.gitignore b/.gitignore index 2fa756f..7170400 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ node_modules ._* -.DS_Store -res/tilemap.js \ No newline at end of file +.DS_Store \ No newline at end of file diff --git a/res/tilemap.js b/res/tilemap.js new file mode 100644 index 0000000..2163922 --- /dev/null +++ b/res/tilemap.js @@ -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 + }, +]; \ No newline at end of file diff --git a/res/tilemap.min.js b/res/tilemap.min.js deleted file mode 100644 index 73d63d8..0000000 --- a/res/tilemap.min.js +++ /dev/null @@ -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}]; \ No newline at end of file diff --git a/src/levels/level.js b/src/levels/level.js index ce799e7..283407a 100644 --- a/src/levels/level.js +++ b/src/levels/level.js @@ -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");