Guest User

Untitled

a guest
Jul 22nd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. // Mapping with:
  2. // - Single index for putTileAt
  3. // - Array of weights for weightedRandomize
  4. // - Array or 2D array for putTilesAt
  5. const TILE_MAPPING = {
  6. WALL: {
  7. TOP_LEFT: 3,
  8. TOP_RIGHT: 4,
  9. BOTTOM_RIGHT: 23,
  10. BOTTOM_LEFT: 22,
  11. // Let's add some randomization to the walls while we are refactoring:
  12. TOP: [{ index: 39, weight: 4 }, { index: [57, 58, 59], weight: 1 }],
  13. LEFT: [{ index: 21, weight: 4 }, { index: [76, 95, 114], weight: 1 }],
  14. RIGHT: [{ index: 19, weight: 4 }, { index: [77, 96, 115], weight: 1 }],
  15. BOTTOM: [{ index: 1, weight: 4 }, { index: [78, 79, 80], weight: 1 }]
  16. },
  17. FLOOR: [{ index: 6, weight: 9 }, { index: [7, 8, 26], weight: 1 }],
  18. POT: [{ index: 13, weight: 1 }, { index: 32, weight: 1 }, { index: 51, weight: 1 }],
  19. DOOR: {
  20. TOP: [40, 6, 38],
  21. // prettier-ignore
  22. LEFT: [
  23. [40],
  24. [6],
  25. [2]
  26. ],
  27. BOTTOM: [2, 6, 0],
  28. // prettier-ignore
  29. RIGHT: [
  30. [38],
  31. [6],
  32. [0]
  33. ]
  34. },
  35. CHEST: 166,
  36. STAIRS: 81,
  37. // prettier-ignore
  38. TOWER: [
  39. [186],
  40. [205]
  41. ]
  42. };
  43.  
  44. export default TILE_MAPPING;
Add Comment
Please, Sign In to add comment