a munch adventure
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

47 lines
674 B

  1. "use strict"
  2. let audioContext;
  3. let state = {
  4. player: {
  5. items: {
  6. keys: [
  7. ]
  8. },
  9. rooms: {
  10. }
  11. }
  12. }
  13. function print(lines) {
  14. (lines.concat([String.fromCharCode(160)])).forEach(line => {
  15. const log = document.querySelector("#log");
  16. const div = document.createElement("div");
  17. div.textContent = line;
  18. log.appendChild(div);
  19. });
  20. log.scrollTop = log.scrollHeight;
  21. }
  22. function refresh() {
  23. updateRoom(state);
  24. updateWorldInfo(state);
  25. }
  26. // setup the game
  27. function init() {
  28. initWorld("demo", state);
  29. initAudio("demo", state);
  30. initGame("demo", state);
  31. goToRoom("Home", state);
  32. }
  33. window.addEventListener("load", init);