Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  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(map.getWidth() - 5, y, 'block');
  30. }
  31.  
  32. for (x = 5; x <= map.getWidth() -5; x++) {
  33. map.placeObject(x, 3, 'block');
  34. map.placeObject(x, map.getHeight() - 10, 'block');
  35. }
  36.  
  37. map.placeObject(15, 12, 'computer');
  38.  
  39. map.placeObject(map.getWidth()-7, map.getHeight()-5, 'exit');
  40. }
  41.  
  42. function onExit(map) {
  43. if (!map.getPlayer().hasItem('computer')) {
  44. map.writeStatus("Don't forget to pick up the computer!");
  45. return false;
  46. } else {
  47. return true;
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement