pxt-common-packages 10.3.10 → 10.3.12

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 (34) hide show
  1. package/built/common-sim.d.ts +6 -0
  2. package/built/common-sim.js +15 -2
  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 +8627 -8381
  7. package/libs/controller---none/built/debug/binary.js +8606 -8360
  8. package/libs/datalogger/built/debug/binary.js +63 -63
  9. package/libs/edge-connector/built/debug/binary.js +8 -8
  10. package/libs/esp32/built/debug/binary.js +462 -462
  11. package/libs/game/built/debug/binary.js +9031 -8785
  12. package/libs/game/controller.ts +5 -0
  13. package/libs/game/multiplayer.ts +39 -0
  14. package/libs/game/sim/multiplayer.ts +23 -2
  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/mqtt/built/debug/binary.js +176 -176
  20. package/libs/multiplayer/player.ts +15 -0
  21. package/libs/net/built/debug/binary.js +176 -176
  22. package/libs/net-game/built/debug/binary.js +10613 -10367
  23. package/libs/palette/built/debug/binary.js +9030 -8784
  24. package/libs/pixel/built/debug/binary.js +8 -8
  25. package/libs/power/built/debug/binary.js +8 -8
  26. package/libs/proximity/built/debug/binary.js +8 -8
  27. package/libs/radio/built/debug/binary.js +8 -8
  28. package/libs/radio-broadcast/built/debug/binary.js +8 -8
  29. package/libs/rotary-encoder/built/debug/binary.js +8 -8
  30. package/libs/screen/built/debug/binary.js +50 -50
  31. package/libs/servo/built/debug/binary.js +8 -8
  32. package/libs/sprite-scaling/built/debug/binary.js +9030 -8784
  33. package/libs/storyboard/built/debug/binary.js +9030 -8784
  34. package/package.json +1 -1
@@ -57,6 +57,9 @@ namespace mp {
57
57
  _state: number[];
58
58
  _index: number;
59
59
  _data: any;
60
+ _mwb: boolean;
61
+ _vx: number;
62
+ _vy: number;
60
63
 
61
64
  constructor(index: number) {
62
65
  this._index = index;
@@ -110,10 +113,22 @@ namespace mp {
110
113
  );
111
114
 
112
115
  }
116
+
117
+ if (this._sprite && this._mwb) {
118
+ this._getController().stopControllingSprite(this._sprite);
119
+ }
120
+
113
121
  this._sprite = sprite;
122
+
123
+ if (this._sprite && this._mwb) {
124
+ this._getController().moveSprite(this._sprite, this._vx, this._vy);
125
+ }
114
126
  }
115
127
 
116
128
  moveWithButtons(vx?: number, vy?: number) {
129
+ this._mwb = true;
130
+ this._vx = vx;
131
+ this._vy = vy;
117
132
  this._getController().moveSprite(this.getSprite(), vx, vy);
118
133
  }
119
134