pxt-arcade 1.13.1 → 1.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/built/common-sim.js +5 -5
  2. package/built/sim.js +13 -5
  3. package/built/target.js +507 -289
  4. package/built/target.json +507 -289
  5. package/built/targetlight.json +5 -5
  6. package/docs/beta-ref.json +1 -1
  7. package/docs/hardware/kiosk.md +44 -77
  8. package/docs/hero-banner.md +9 -8
  9. package/docs/index-ref.json +1 -1
  10. package/docs/kiosk.html +31 -3
  11. package/docs/multiplayer-games.md +6 -0
  12. package/docs/multiplayer.md +0 -3
  13. package/docs/projects.md +2 -1
  14. package/docs/skillmap/balloon/balloon1.md +3 -16
  15. package/docs/skillmap/balloon/balloon2.md +3 -15
  16. package/docs/skillmap/balloon/balloon3.md +3 -16
  17. package/docs/skillmap/balloon/balloon4.md +18 -17
  18. package/docs/skillmap/mole/mole1.md +15 -114
  19. package/docs/skillmap/mole/mole2.md +28 -105
  20. package/docs/skillmap/mole/mole3.md +9 -105
  21. package/docs/skillmap/mole/mole4.md +37 -125
  22. package/docs/stable-ref.json +1 -1
  23. package/docs/static/hardware/kiosk/hot-air-balloon.png +0 -0
  24. package/docs/static/hardware/kiosk/makecode-arcade-machines.jpg +0 -0
  25. package/docs/static/hardware/kiosk/no-uploaded-games.png +0 -0
  26. package/docs/static/hardware/kiosk/select-a-game.png +0 -0
  27. package/docs/static/hardware/kiosk/share-button.png +0 -0
  28. package/docs/static/hardware/kiosk/share-kiosk-button.png +0 -0
  29. package/docs/static/hardware/kiosk/share-kiosk-code.png +0 -0
  30. package/docs/static/hardware/kiosk/share-project.png +0 -0
  31. package/docs/static/hardware/kiosk/single-uploaded-game.png +0 -0
  32. package/docs/static/kiosk/asset-manifest.json +3 -3
  33. package/docs/static/kiosk/static/js/{main.3ab95ea3.js → main.f94a16a2.js} +3 -3
  34. package/docs/static/kiosk/static/js/{main.3ab95ea3.js.LICENSE.txt → main.f94a16a2.js.LICENSE.txt} +0 -0
  35. package/docs/static/kiosk/static/js/{main.3ab95ea3.js.map → main.f94a16a2.js.map} +1 -1
  36. package/docs/test/skillmap/balloon/balloon1.md +245 -0
  37. package/docs/test/skillmap/balloon/balloon2.md +365 -0
  38. package/docs/test/skillmap/balloon/balloon3.md +374 -0
  39. package/docs/test/skillmap/balloon/balloon4.md +389 -0
  40. package/docs/test/skillmap/dino/dino1.md +3 -3
  41. package/docs/test/skillmap/dino/dino2.md +9 -9
  42. package/docs/test/skillmap/mole/mole1.md +296 -0
  43. package/docs/test/skillmap/mole/mole2.md +345 -0
  44. package/docs/test/skillmap/mole/mole3.md +288 -0
  45. package/docs/test/skillmap/mole/mole4.md +431 -0
  46. package/docs/test/tutorials/arrow.md +71 -66
  47. package/docs/test/tutorials/collect-clovers.md +662 -891
  48. package/docs/test/tutorials/holiday.md +133 -192
  49. package/docs/test/tutorials/horse.md +227 -225
  50. package/docs/test/tutorials/time-flies.md +198 -117
  51. package/docs/tutorials/collect-the-clovers.md +662 -891
  52. package/docs/tutorials/froggy.md +198 -117
  53. package/package.json +4 -4
  54. package/docs/static/hardware/kiosk/add-to-kiosk.png +0 -0
  55. package/docs/static/hardware/kiosk/add-your-game.png +0 -0
  56. package/docs/static/hardware/kiosk/keyboard-controls.png +0 -0
  57. package/docs/static/hardware/kiosk/locked-state.png +0 -0
  58. package/docs/static/hardware/kiosk/menu-bar.png +0 -0
  59. package/docs/static/hardware/kiosk/multiple-uploaded-games.png +0 -0
  60. package/docs/static/hardware/kiosk/qr-code-enlarged.png +0 -0
  61. package/docs/static/hardware/kiosk/shared-project-link.png +0 -0
  62. package/docs/static/hardware/kiosk/shared-project-name.png +0 -0
@@ -2554,11 +2554,13 @@ var pxsim;
2554
2554
  }
2555
2555
  multiplayer.postImage = postImage;
2556
2556
  function postIcon(iconType, slot, im) {
2557
- if (im._width * im._height > 64 * 64) {
2557
+ if (im && (im._width * im._height > 64 * 64)) {
2558
2558
  // setting 64x64 as max size for icon for now
2559
2559
  return;
2560
2560
  }
2561
- const asBuf = pxsim.image.toBuffer(im);
2561
+ // treat empty icon as undefined
2562
+ const asBuf = (im && im.data.some(pixel => pixel != 0))
2563
+ ? pxsim.image.toBuffer(im) : undefined;
2562
2564
  const sb = pxsim.board();
2563
2565
  const screenState = sb && sb.screenState;
2564
2566
  pxsim.getMultiplayerState().send({
@@ -2667,9 +2669,7 @@ var pxsim;
2667
2669
  }
2668
2670
  }
2669
2671
  else if (isConnectionMessage(msg)) {
2670
- if (this.origin === "server") {
2671
- this.registerConnectionState(msg.slot, msg.connected);
2672
- }
2672
+ this.registerConnectionState(msg.slot, msg.connected);
2673
2673
  }
2674
2674
  }
2675
2675
  }
package/built/sim.js CHANGED
@@ -171,6 +171,8 @@ var pxsim;
171
171
  registerPointerEvents();
172
172
  if (!!searchParams.get("hideSimButtons"))
173
173
  hideSimButtons();
174
+ if (!!searchParams.get("noExtraPadding"))
175
+ noExtraPadding();
174
176
  });
175
177
  function hideSimButtons() {
176
178
  const gamePlayer = document.getElementsByClassName("game-player");
@@ -178,6 +180,12 @@ var pxsim;
178
180
  gamePlayer[0].classList.add("just-screen");
179
181
  }
180
182
  }
183
+ function noExtraPadding() {
184
+ const gamePlayer = document.getElementsByClassName("game-player");
185
+ if (gamePlayer && gamePlayer.length) {
186
+ gamePlayer[0].classList.add("no-padding");
187
+ }
188
+ }
181
189
  function registerPointerEvents() {
182
190
  const canvas = document.getElementById("game-screen");
183
191
  const encoder = new TextEncoder();
@@ -2868,11 +2876,13 @@ var pxsim;
2868
2876
  }
2869
2877
  multiplayer.postImage = postImage;
2870
2878
  function postIcon(iconType, slot, im) {
2871
- if (im._width * im._height > 64 * 64) {
2879
+ if (im && (im._width * im._height > 64 * 64)) {
2872
2880
  // setting 64x64 as max size for icon for now
2873
2881
  return;
2874
2882
  }
2875
- const asBuf = pxsim.image.toBuffer(im);
2883
+ // treat empty icon as undefined
2884
+ const asBuf = (im && im.data.some(pixel => pixel != 0))
2885
+ ? pxsim.image.toBuffer(im) : undefined;
2876
2886
  const sb = pxsim.board();
2877
2887
  const screenState = sb && sb.screenState;
2878
2888
  pxsim.getMultiplayerState().send({
@@ -2981,9 +2991,7 @@ var pxsim;
2981
2991
  }
2982
2992
  }
2983
2993
  else if (isConnectionMessage(msg)) {
2984
- if (this.origin === "server") {
2985
- this.registerConnectionState(msg.slot, msg.connected);
2986
- }
2994
+ this.registerConnectionState(msg.slot, msg.connected);
2987
2995
  }
2988
2996
  }
2989
2997
  }