Advertisement
Guest User

LvL2

a guest
Apr 7th, 2014
668
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.    
  16.     //DESTROY THE WALLS WITH YOUR MIND RAY
  17.     maze.create = function(){};
  18.    
  19.     //MAKE THAT EXIT COME KNEEL BEFORE ZOD
  20.     map.placeObject(7,6, 'exit');
  21.    
  22.    
  23.     maze.create( function (x, y, mapValue) {
  24.  
  25.         // don't write maze over player
  26.         if (map.getPlayer().atLocation(x,y)) {
  27.             return 0;
  28.         }
  29.  
  30.         else if (mapValue === 1) { //0 is empty space 1 is wall
  31.             map.placeObject(x,y, 'block');
  32.         }
  33.         else {
  34.             map.placeObject(x,y,'empty');
  35.         }
  36.     });
  37.  
  38.     map.placeObject(map.getWidth()-4, map.getHeight()-4, 'block');
  39.     map.placeObject(map.getWidth()-6, map.getHeight()-4, 'block');
  40.     map.placeObject(map.getWidth()-5, map.getHeight()-5, 'block');
  41.     map.placeObject(map.getWidth()-5, map.getHeight()-3, 'block');
  42.    
  43.     map.placeObject(map.getWidth()-5, map.getHeight()-4, 'exit');
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement