pxt-common-packages 10.2.2 → 10.2.4

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 (38) hide show
  1. package/built/common-sim.d.ts +1 -1
  2. package/built/common-sim.js +7 -3
  3. package/libs/azureiot/built/debug/binary.js +461 -461
  4. package/libs/color/built/debug/binary.js +8 -8
  5. package/libs/color-sensor/built/debug/binary.js +8 -8
  6. package/libs/controller/built/debug/binary.js +6956 -6956
  7. package/libs/controller---none/built/debug/binary.js +6936 -6936
  8. package/libs/datalogger/built/debug/binary.js +63 -63
  9. package/libs/edge-connector/built/debug/binary.js +9 -9
  10. package/libs/esp32/built/debug/binary.js +462 -462
  11. package/libs/game/assetTemplates.ts +10 -0
  12. package/libs/game/built/debug/binary.js +6875 -6875
  13. package/libs/game/sim/keymap.ts +1 -1
  14. package/libs/game/sim/multiplayer.ts +8 -3
  15. package/libs/lcd/built/debug/binary.js +8 -8
  16. package/libs/light-spectrum-sensor/built/debug/binary.js +8 -8
  17. package/libs/lora/built/debug/binary.js +8 -8
  18. package/libs/matrix-keypad/built/debug/binary.js +8 -8
  19. package/libs/mixer/instrument.ts +776 -0
  20. package/libs/mixer/melody.h +1 -1
  21. package/libs/mixer/melody.ts +29 -1
  22. package/libs/mixer/pxt.json +2 -0
  23. package/libs/mixer/sequencer.ts +88 -0
  24. package/libs/mqtt/built/debug/binary.js +176 -176
  25. package/libs/net/built/debug/binary.js +176 -176
  26. package/libs/net-game/built/debug/binary.js +8464 -8464
  27. package/libs/palette/built/debug/binary.js +6874 -6874
  28. package/libs/pixel/built/debug/binary.js +8 -8
  29. package/libs/power/built/debug/binary.js +8 -8
  30. package/libs/proximity/built/debug/binary.js +8 -8
  31. package/libs/radio/built/debug/binary.js +8 -8
  32. package/libs/radio-broadcast/built/debug/binary.js +8 -8
  33. package/libs/rotary-encoder/built/debug/binary.js +8 -8
  34. package/libs/screen/built/debug/binary.js +50 -50
  35. package/libs/servo/built/debug/binary.js +8 -8
  36. package/libs/sprite-scaling/built/debug/binary.js +6874 -6874
  37. package/libs/storyboard/built/debug/binary.js +6874 -6874
  38. package/package.json +1 -1
@@ -794,7 +794,7 @@ declare namespace pxsim {
794
794
  interface MultiplayerImageMessage extends SimulatorMultiplayerMessage {
795
795
  content: "Image";
796
796
  goal: string;
797
- image: RefImage;
797
+ image: RefBuffer;
798
798
  }
799
799
  interface MultiplayerButtonEvent extends SimulatorMultiplayerMessage {
800
800
  content: "Button";
@@ -2527,7 +2527,7 @@ var pxsim;
2527
2527
  }
2528
2528
  clearMap(name) {
2529
2529
  const keyCodes = this.mappings[name];
2530
- keyCodes === null || keyCodes === void 0 ? void 0 : keyCodes.forEach(keyCode => delete this.keymap[keyCode]);
2530
+ keyCodes && keyCodes.forEach(keyCode => delete this.keymap[keyCode]);
2531
2531
  delete this.mappings[name];
2532
2532
  }
2533
2533
  }
@@ -2565,6 +2565,7 @@ var pxsim;
2565
2565
  return pxsim.board().multiplayerState;
2566
2566
  }
2567
2567
  pxsim.getMultiplayerState = getMultiplayerState;
2568
+ let postScreenInterval;
2568
2569
  class MultiplayerState {
2569
2570
  constructor() {
2570
2571
  this.lastMessageId = 0;
@@ -2575,7 +2576,10 @@ var pxsim;
2575
2576
  init(origin) {
2576
2577
  this.origin = origin;
2577
2578
  pxsim.runtime.board.addMessageListener(msg => this.messageHandler(msg));
2578
- setInterval(() => {
2579
+ if (postScreenInterval) {
2580
+ clearInterval(postScreenInterval);
2581
+ }
2582
+ postScreenInterval = setInterval(() => {
2579
2583
  if (this.origin === "server") {
2580
2584
  const b = pxsim.board();
2581
2585
  const screenState = b && b.screenState;
@@ -2608,7 +2612,7 @@ var pxsim;
2608
2612
  }
2609
2613
  else if (isButtonMessage(msg)) {
2610
2614
  if (this.origin === "server") {
2611
- pxsim.board().setButton(msg.button + (7 * (msg.clientNumber || 1)), // + 7 to make it player 2 controls,
2615
+ pxsim.board().handleKeyEvent(msg.button + (7 * (msg.clientNumber || 1)), // + 7 to make it player 2 controls,
2612
2616
  msg.state === "Pressed" || msg.state === "Held");
2613
2617
  }
2614
2618
  }