Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. /********************
  2. * theLongWayOut.js *
  3. ********************
  4. *
  5. * Well, it looks like they're on to us. The path isn't as
  6. * clear as I thought it'd be. But no matter - four clever
  7. * characters should be enough to erase all their tricks.
  8. */
  9.  
  10. function startLevel(map) {
  11. map.placePlayer(7, 5);
  12.  
  13. var maze = new ROT.Map.DividedMaze(map.getWidth(), map.getHeight());
  14.  
  15. for(let i = 0; i < map.getHeight(); i++) {
  16. for(let j = 0; j < map.getWidth(); j++) {
  17. if(i == 7 && j == 5) {
  18. continue;
  19. }
  20. map.placeObject(i, j, 'empty');
  21. }
  22. }
  23. // map.placeObject(7, 4, 'empty');
  24. // map.placeObject(7, 6, 'empty');
  25.  
  26. if (false) {
  27.  
  28. maze.create( function (x, y, mapValue) {
  29.  
  30. // don't write maze over player
  31. if (map.getPlayer().atLocation(x,y)) {
  32. return 0;
  33. }
  34.  
  35. else if (mapValue === 1) { //0 is empty space 1 is wall
  36. map.placeObject(x,y, 'block');
  37. }
  38. else {
  39. map.placeObject(x,y,'empty');
  40. }
  41. });
  42.  
  43. map.placeObject(map.getWidth()-4, map.getHeight()-4, 'block');
  44. map.placeObject(map.getWidth()-6, map.getHeight()-4, 'block');
  45. map.placeObject(map.getWidth()-5, map.getHeight()-5, 'block');
  46. map.placeObject(map.getWidth()-5, map.getHeight()-3, 'block');
  47.  
  48. }
  49.  
  50. map.placeObject(map.getWidth()-5, map.getHeight()-4, 'exit');
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement