pxt-common-packages 10.3.5 → 10.3.7
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.
- package/libs/azureiot/built/debug/binary.js +461 -461
- package/libs/color/built/debug/binary.js +8 -8
- package/libs/color-sensor/built/debug/binary.js +8 -8
- package/libs/controller/built/debug/binary.js +7239 -7205
- package/libs/controller---none/built/debug/binary.js +7219 -7185
- package/libs/datalogger/built/debug/binary.js +63 -63
- package/libs/edge-connector/built/debug/binary.js +8 -8
- package/libs/esp32/built/debug/binary.js +462 -462
- package/libs/game/animation.ts +403 -323
- package/libs/game/built/debug/binary.js +7158 -7124
- package/libs/game/controller.ts +6 -0
- package/libs/game/info.ts +9 -0
- package/libs/game/physics.ts +2 -2
- package/libs/lcd/built/debug/binary.js +8 -8
- package/libs/light-spectrum-sensor/built/debug/binary.js +8 -8
- package/libs/lora/built/debug/binary.js +8 -8
- package/libs/matrix-keypad/built/debug/binary.js +8 -8
- package/libs/mixer/instrument.ts +22 -3
- package/libs/mixer/sequencer.ts +2 -2
- package/libs/mqtt/built/debug/binary.js +176 -176
- package/libs/multiplayer/fieldEditors.ts +1 -9
- package/libs/multiplayer/images.ts +1 -1
- package/libs/multiplayer/player.ts +706 -0
- package/libs/multiplayer/pxt.json +1 -1
- package/libs/multiplayer/stateKind.ts +2 -2
- package/libs/net/built/debug/binary.js +176 -176
- package/libs/net-game/built/debug/binary.js +8747 -8713
- package/libs/palette/built/debug/binary.js +7153 -7119
- package/libs/pixel/built/debug/binary.js +8 -8
- package/libs/power/built/debug/binary.js +8 -8
- package/libs/proximity/built/debug/binary.js +8 -8
- package/libs/radio/built/debug/binary.js +8 -8
- package/libs/radio-broadcast/built/debug/binary.js +8 -8
- package/libs/rotary-encoder/built/debug/binary.js +8 -8
- package/libs/screen/built/debug/binary.js +50 -50
- package/libs/servo/built/debug/binary.js +8 -8
- package/libs/sprite-scaling/built/debug/binary.js +7157 -7123
- package/libs/storyboard/built/debug/binary.js +7157 -7123
- package/package.json +1 -1
- package/libs/multiplayer/mp.ts +0 -643
package/libs/game/controller.ts
CHANGED
|
@@ -165,6 +165,7 @@ namespace controller {
|
|
|
165
165
|
//% vx.shadow="spriteSpeedPicker"
|
|
166
166
|
//% vy.shadow="spriteSpeedPicker"
|
|
167
167
|
//% parts="multiplayer"
|
|
168
|
+
//% deprecated=true
|
|
168
169
|
moveSprite(sprite: Sprite, vx: number = 100, vy: number = 100) {
|
|
169
170
|
this._moveSpriteInternal(sprite, vx, vy);
|
|
170
171
|
}
|
|
@@ -201,6 +202,7 @@ namespace controller {
|
|
|
201
202
|
//% group="Multiplayer"
|
|
202
203
|
//% help=controller/on-button-event
|
|
203
204
|
//% parts="multiplayer"
|
|
205
|
+
//% deprecated=true
|
|
204
206
|
onButtonEvent(btn: ControllerButton, event: ControllerButtonEvent, handler: () => void) {
|
|
205
207
|
this.button(btn).onEvent(event, handler);
|
|
206
208
|
}
|
|
@@ -215,6 +217,7 @@ namespace controller {
|
|
|
215
217
|
//% group="Multiplayer"
|
|
216
218
|
//% help=controller/on-event
|
|
217
219
|
//% parts="multiplayer"
|
|
220
|
+
//% deprecated=true
|
|
218
221
|
onEvent(event: ControllerEvent, handler: () => void) {
|
|
219
222
|
control.onEvent(this.id, event, handler);
|
|
220
223
|
}
|
|
@@ -237,6 +240,7 @@ namespace controller {
|
|
|
237
240
|
//% blockId=ctrlispressed block="is %controller %button **button** pressed"
|
|
238
241
|
//% group="Multiplayer"
|
|
239
242
|
//% parts="multiplayer"
|
|
243
|
+
//% deprecated=true
|
|
240
244
|
isPressed(btn: ControllerButton): boolean {
|
|
241
245
|
return this.button(btn).isPressed();
|
|
242
246
|
}
|
|
@@ -250,6 +254,7 @@ namespace controller {
|
|
|
250
254
|
//% step.defl=100
|
|
251
255
|
//% group="Multiplayer"
|
|
252
256
|
//% parts="multiplayer"
|
|
257
|
+
//% deprecated=true
|
|
253
258
|
dx(step: number = 100) {
|
|
254
259
|
return this._dxInternal(step);
|
|
255
260
|
}
|
|
@@ -279,6 +284,7 @@ namespace controller {
|
|
|
279
284
|
//% step.defl=100
|
|
280
285
|
//% group="Multiplayer"
|
|
281
286
|
//% parts="multiplayer"
|
|
287
|
+
//% deprecated=true
|
|
282
288
|
dy(step: number = 100) {
|
|
283
289
|
return this._dyInternal(step);
|
|
284
290
|
}
|
package/libs/game/info.ts
CHANGED
|
@@ -858,6 +858,7 @@ namespace info {
|
|
|
858
858
|
//% blockId=piscore block="%player score"
|
|
859
859
|
//% help=info/score
|
|
860
860
|
//% parts="multiplayer"
|
|
861
|
+
//% deprecated=true
|
|
861
862
|
score(): number {
|
|
862
863
|
return this.impl.score();
|
|
863
864
|
}
|
|
@@ -870,6 +871,7 @@ namespace info {
|
|
|
870
871
|
//% value.defl=0
|
|
871
872
|
//% help=info/set-score
|
|
872
873
|
//% parts="multiplayer"
|
|
874
|
+
//% deprecated=true
|
|
873
875
|
setScore(value: number) {
|
|
874
876
|
this.impl.setScore(value);
|
|
875
877
|
}
|
|
@@ -883,6 +885,7 @@ namespace info {
|
|
|
883
885
|
//% value.defl=1
|
|
884
886
|
//% help=info/change-score-by
|
|
885
887
|
//% parts="multiplayer"
|
|
888
|
+
//% deprecated=true
|
|
886
889
|
changeScoreBy(value: number): void {
|
|
887
890
|
this.impl.changeScoreBy(value);
|
|
888
891
|
}
|
|
@@ -898,6 +901,7 @@ namespace info {
|
|
|
898
901
|
//% blockid=piflife block="%player life"
|
|
899
902
|
//% help=info/life
|
|
900
903
|
//% parts="multiplayer"
|
|
904
|
+
//% deprecated=true
|
|
901
905
|
life(): number {
|
|
902
906
|
return this.impl.life();
|
|
903
907
|
}
|
|
@@ -910,6 +914,7 @@ namespace info {
|
|
|
910
914
|
//% value.defl=3
|
|
911
915
|
//% help=info/set-life
|
|
912
916
|
//% parts="multiplayer"
|
|
917
|
+
//% deprecated=true
|
|
913
918
|
setLife(value: number): void {
|
|
914
919
|
this.impl.setLife(value);
|
|
915
920
|
}
|
|
@@ -923,6 +928,7 @@ namespace info {
|
|
|
923
928
|
//% value.defl=-1
|
|
924
929
|
//% help=info/change-life-by
|
|
925
930
|
//% parts="multiplayer"
|
|
931
|
+
//% deprecated=true
|
|
926
932
|
changeLifeBy(value: number): void {
|
|
927
933
|
this.impl.changeLifeBy(value);
|
|
928
934
|
}
|
|
@@ -936,6 +942,7 @@ namespace info {
|
|
|
936
942
|
//% blockId=pihaslife block="%player has life"
|
|
937
943
|
//% help=info/has-life
|
|
938
944
|
//% parts="multiplayer"
|
|
945
|
+
//% deprecated=true
|
|
939
946
|
hasLife(): boolean {
|
|
940
947
|
return this.impl.hasLife();
|
|
941
948
|
}
|
|
@@ -948,6 +955,7 @@ namespace info {
|
|
|
948
955
|
//% blockId=playerinfoonlifezero block="on %player life zero"
|
|
949
956
|
//% help=info/on-life-zero
|
|
950
957
|
//% parts="multiplayer"
|
|
958
|
+
//% deprecated=true
|
|
951
959
|
onLifeZero(handler: () => void) {
|
|
952
960
|
this.impl.onLifeZero(handler);
|
|
953
961
|
}
|
|
@@ -966,6 +974,7 @@ namespace info {
|
|
|
966
974
|
//% help=info/on-score
|
|
967
975
|
//% group="Multiplayer"
|
|
968
976
|
//% parts="multiplayer"
|
|
977
|
+
//% deprecated=true
|
|
969
978
|
onScore(score: number, handler: () => void) {
|
|
970
979
|
this.impl.onScore(score, handler);
|
|
971
980
|
}
|
package/libs/game/physics.ts
CHANGED
|
@@ -466,7 +466,7 @@ class ArcadePhysicsEngine extends PhysicsEngine {
|
|
|
466
466
|
|
|
467
467
|
if (s.flags & sprites.Flag.DestroyOnWall) {
|
|
468
468
|
s.destroy();
|
|
469
|
-
} else if (s._vx === movingSprite.cachedVx) {
|
|
469
|
+
} else if (s._vx === movingSprite.cachedVx && !(s.flags & SPRITE_NO_WALL_COLLISION)) {
|
|
470
470
|
// sprite collision event didn't change velocity in this direction;
|
|
471
471
|
// apply normal updates
|
|
472
472
|
if (s.flags & sprites.Flag.BounceOnWall) {
|
|
@@ -547,7 +547,7 @@ class ArcadePhysicsEngine extends PhysicsEngine {
|
|
|
547
547
|
|
|
548
548
|
if (s.flags & sprites.Flag.DestroyOnWall) {
|
|
549
549
|
s.destroy();
|
|
550
|
-
} else if (s._vy === movingSprite.cachedVy) {
|
|
550
|
+
} else if (s._vy === movingSprite.cachedVy && !(s.flags & SPRITE_NO_WALL_COLLISION)) {
|
|
551
551
|
// sprite collision event didn't change velocity in this direction;
|
|
552
552
|
// apply normal updates
|
|
553
553
|
if (s.flags & sprites.Flag.BounceOnWall) {
|
|
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
|
|
|
56
56
|
const pxsim_numops = pxsim.numops;
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
function
|
|
59
|
+
function _main___P48571(s) {
|
|
60
60
|
let r0 = s.r0, step = s.pc;
|
|
61
61
|
s.pc = -1;
|
|
62
62
|
|
|
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
|
|
|
66
66
|
switch (step) {
|
|
67
67
|
case 0:
|
|
68
68
|
|
|
69
|
-
globals.
|
|
70
|
-
globals.
|
|
69
|
+
globals._intervals___48814 = (undefined);
|
|
70
|
+
globals._pollEventQueue___48827 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P48571.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"characterlcd.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P48571.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P48571_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P48571, depth: s.depth + 1,
|
|
82
82
|
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
|
|
83
83
|
} }
|
|
84
84
|
|
|
@@ -88,5 +88,5 @@ function _main___P48577_mk(s) {
|
|
|
88
88
|
|
|
89
89
|
const breakpoints = setupDebugger(1, [])
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return _main___P48571
|
|
92
92
|
})
|
|
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
|
|
|
56
56
|
const pxsim_numops = pxsim.numops;
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
function
|
|
59
|
+
function _main___P98045(s) {
|
|
60
60
|
let r0 = s.r0, step = s.pc;
|
|
61
61
|
s.pc = -1;
|
|
62
62
|
|
|
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
|
|
|
66
66
|
switch (step) {
|
|
67
67
|
case 0:
|
|
68
68
|
|
|
69
|
-
globals.
|
|
70
|
-
globals.
|
|
69
|
+
globals._intervals___98288 = (undefined);
|
|
70
|
+
globals._pollEventQueue___98301 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P98045.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"tsl2591.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P98045.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P98045_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P98045, depth: s.depth + 1,
|
|
82
82
|
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
|
|
83
83
|
} }
|
|
84
84
|
|
|
@@ -88,5 +88,5 @@ function _main___P98063_mk(s) {
|
|
|
88
88
|
|
|
89
89
|
const breakpoints = setupDebugger(1, [])
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return _main___P98045
|
|
92
92
|
})
|
|
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
|
|
|
56
56
|
const pxsim_numops = pxsim.numops;
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
function
|
|
59
|
+
function _main___P59873(s) {
|
|
60
60
|
let r0 = s.r0, step = s.pc;
|
|
61
61
|
s.pc = -1;
|
|
62
62
|
|
|
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
|
|
|
66
66
|
switch (step) {
|
|
67
67
|
case 0:
|
|
68
68
|
|
|
69
|
-
globals.
|
|
70
|
-
globals.
|
|
69
|
+
globals._intervals___60116 = (undefined);
|
|
70
|
+
globals._pollEventQueue___60129 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P59873.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"lora.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P59873.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P59873_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P59873, depth: s.depth + 1,
|
|
82
82
|
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
|
|
83
83
|
} }
|
|
84
84
|
|
|
@@ -88,5 +88,5 @@ function _main___P59879_mk(s) {
|
|
|
88
88
|
|
|
89
89
|
const breakpoints = setupDebugger(1, [])
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return _main___P59873
|
|
92
92
|
})
|
|
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
|
|
|
56
56
|
const pxsim_numops = pxsim.numops;
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
function
|
|
59
|
+
function _main___P190517(s) {
|
|
60
60
|
let r0 = s.r0, step = s.pc;
|
|
61
61
|
s.pc = -1;
|
|
62
62
|
|
|
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
|
|
|
66
66
|
switch (step) {
|
|
67
67
|
case 0:
|
|
68
68
|
|
|
69
|
-
globals.
|
|
70
|
-
globals.
|
|
69
|
+
globals._intervals___190760 = (undefined);
|
|
70
|
+
globals._pollEventQueue___190773 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P190517.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"keypad.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P190517.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P190517_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P190517, depth: s.depth + 1,
|
|
82
82
|
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
|
|
83
83
|
} }
|
|
84
84
|
|
|
@@ -88,5 +88,5 @@ function _main___P190559_mk(s) {
|
|
|
88
88
|
|
|
89
89
|
const breakpoints = setupDebugger(1, [])
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return _main___P190517
|
|
92
92
|
})
|
package/libs/mixer/instrument.ts
CHANGED
|
@@ -22,7 +22,7 @@ namespace music.sequencer {
|
|
|
22
22
|
* notes byte length
|
|
23
23
|
* ...note events
|
|
24
24
|
*
|
|
25
|
-
* instrument(
|
|
25
|
+
* instrument(28 bytes)
|
|
26
26
|
* 0 waveform
|
|
27
27
|
* 1 amp attack
|
|
28
28
|
* 3 amp decay
|
|
@@ -38,6 +38,7 @@ namespace music.sequencer {
|
|
|
38
38
|
* 22 amp lfo amp
|
|
39
39
|
* 24 pitch lfo freq
|
|
40
40
|
* 25 pitch lfo amp
|
|
41
|
+
* 27 octave
|
|
41
42
|
*
|
|
42
43
|
* drum(5 + 7 * steps bytes)
|
|
43
44
|
* 0 steps
|
|
@@ -57,6 +58,12 @@ namespace music.sequencer {
|
|
|
57
58
|
* 4 polyphony
|
|
58
59
|
* 5...notes(1 byte each)
|
|
59
60
|
*
|
|
61
|
+
* note (1 byte)
|
|
62
|
+
* lower six bits = note - (instrumentOctave - 2) * 12
|
|
63
|
+
* upper two bits are the enharmonic spelling:
|
|
64
|
+
* 0 = normal
|
|
65
|
+
* 1 = flat
|
|
66
|
+
* 2 = sharp
|
|
60
67
|
*/
|
|
61
68
|
|
|
62
69
|
export class Song {
|
|
@@ -239,8 +246,12 @@ namespace music.sequencer {
|
|
|
239
246
|
return this.polyphony + 5;
|
|
240
247
|
}
|
|
241
248
|
|
|
242
|
-
getNote(offset: number) {
|
|
243
|
-
|
|
249
|
+
getNote(offset: number, octave?: number) {
|
|
250
|
+
const value = this.buf[this.offset + offset + 5] & 0x3f;
|
|
251
|
+
if (octave !== undefined) {
|
|
252
|
+
return value + (octave - 2) * 12
|
|
253
|
+
}
|
|
254
|
+
return value
|
|
244
255
|
}
|
|
245
256
|
|
|
246
257
|
protected getValue(offset: number) {
|
|
@@ -366,6 +377,14 @@ namespace music.sequencer {
|
|
|
366
377
|
set waveform(value: number) {
|
|
367
378
|
this.buf[this.offset] = value;
|
|
368
379
|
}
|
|
380
|
+
|
|
381
|
+
get octave(): number {
|
|
382
|
+
return this.buf[this.offset + 27]
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
set octave(value: number) {
|
|
386
|
+
this.buf[this.offset + 27] = value;
|
|
387
|
+
}
|
|
369
388
|
}
|
|
370
389
|
|
|
371
390
|
export class DrumInstrument {
|
package/libs/mixer/sequencer.ts
CHANGED
|
@@ -65,7 +65,7 @@ namespace music.sequencer {
|
|
|
65
65
|
0,
|
|
66
66
|
renderInstrument(
|
|
67
67
|
track.instrument,
|
|
68
|
-
lookupFrequency(track.currentNoteEvent.getNote(i)),
|
|
68
|
+
lookupFrequency(track.currentNoteEvent.getNote(i, track.instrument.octave)),
|
|
69
69
|
this.tickToMs(track.currentNoteEvent.endTick - track.currentNoteEvent.startTick),
|
|
70
70
|
music.volume()
|
|
71
71
|
)
|
|
@@ -78,7 +78,7 @@ namespace music.sequencer {
|
|
|
78
78
|
playInstructions(
|
|
79
79
|
0,
|
|
80
80
|
renderDrumInstrument(
|
|
81
|
-
track.drums[track.currentNoteEvent.getNote(i)],
|
|
81
|
+
track.drums[track.currentNoteEvent.getNote(i, undefined)],
|
|
82
82
|
music.volume()
|
|
83
83
|
)
|
|
84
84
|
);
|