daily pastebin goal
18%
SHARE
TWEET

Untitled

a guest Apr 17th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*****************
  2.  * cellBlockA.js *
  3.  *****************
  4.  *
  5.  * Good morning, Dr. Eval.
  6.  *
  7.  * It wasn't easy, but I've managed to get your computer down
  8.  * to you. This system might be unfamiliar, but the underlying
  9.  * code is still JavaScript. Just like we predicted.
  10.  *
  11.  * Now, let's get what we came here for and then get you out of
  12.  * here. Easy peasy.
  13.  *
  14.  * I've given you as much access to their code as I could, but
  15.  * it's not perfect. The red background indicates lines that
  16.  * are off-limits from editing.
  17.  *
  18.  * The code currently places blocks in a rectangle surrounding
  19.  * you. All you need to do is make a gap. You don't even need
  20.  * to do anything extra. In fact, you should be doing less.
  21.  */
  22.  
  23. function startLevel(map) {
  24.     map.displayChapter('Chapter 1\nBreakout');
  25.  
  26.     map.placePlayer(7, 5);
  27.  
  28.     for (y = 3; y <= map.getHeight() - 10; y++) {
  29.         map.placeObject(5, y, 'block');
  30.         map.placeObject(map.getWidth() - 5, y, 'block');
  31.     }
  32.  
  33.     for (x = 5; x <= map.getWidth() - 5; x++) {
  34.         if (x === 6) continue;
  35.        
  36.         map.placeObject(x, 3, 'block');
  37.         map.placeObject(x, map.getHeight() - 10, 'block');
  38.     }
  39.  
  40.     map.placeObject(15, 12, 'computer');
  41.  
  42.     map.placeObject(map.getWidth()-7, map.getHeight()-5, 'exit');
  43. }
  44.  
  45. function onExit(map) {
  46.     if (!map.getPlayer().hasItem('computer')) {
  47.         map.writeStatus("Don't forget to pick up the computer!");
  48.         return false;
  49.     } else {
  50.         return true;
  51.     }
  52. }
RAW Paste Data
Top