pxt-common-packages 11.1.6 → 12.0.2
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/built/common-sim.js +4 -4
- package/libs/azureiot/built/debug/binary.js +461 -461
- package/libs/base/configkeys.h +1 -0
- 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 +7121 -7121
- package/libs/controller---none/built/debug/binary.js +7101 -7101
- 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/_locales/game-strings.json +1 -0
- package/libs/game/animation.ts +1 -0
- package/libs/game/assetTemplates.ts +4 -0
- package/libs/game/built/debug/binary.js +7040 -7040
- package/libs/game/docs/reference/controller/dy.md +2 -2
- package/libs/game/docs/reference/info/countdown.md +1 -7
- package/libs/game/docs/reference/scene/get-tile-location.md +1 -0
- package/libs/game/docs/reference/scene/tile-at-location-equals.md +1 -0
- package/libs/game/docs/reference/scene/tile-at-location-is-wall.md +1 -0
- package/libs/game/game.ts +11 -1
- package/libs/game/info.ts +7 -2
- package/libs/game/tilemap.ts +2 -0
- 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/sim/music.ts +4 -4
- package/libs/mqtt/built/debug/binary.js +176 -176
- package/libs/net/built/debug/binary.js +176 -176
- package/libs/net-game/built/debug/binary.js +8629 -8629
- package/libs/palette/built/debug/binary.js +7039 -7039
- 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/servo/docs/reference/servos/set-pulse.md +1 -1
- package/libs/settings/settings.cpp +5 -0
- package/libs/sprite-scaling/built/debug/binary.js +7039 -7039
- package/libs/storyboard/built/debug/binary.js +7039 -7039
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dy
|
|
2
2
|
|
|
3
3
|
Gets the amount of vertical movement to use if an up or down key is pressed.
|
|
4
4
|
|
|
5
5
|
```sig
|
|
6
|
-
controller.
|
|
6
|
+
controller.dy(0)
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
If you're controlling the location of a sprite by key pressess, you can decide how much change in position it will have when a key is pressed. This is done with _steps_. While a direction key is pressed, the movement value returned is based on if and how long the key is pressed, along with the step size you gave it. If you want fast movement, then you use a larger step size.
|
|
@@ -3,15 +3,9 @@
|
|
|
3
3
|
Get the current game countdown time.
|
|
4
4
|
|
|
5
5
|
```sig
|
|
6
|
-
info.
|
|
6
|
+
info.countdown()
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
The current game countdown time amount is increased by adding the change value when it is greater than zero (positive). If the change number is less than zero (negative), the game countdown is reduced by the value of the change number.
|
|
10
|
-
|
|
11
|
-
## Parameters
|
|
12
|
-
|
|
13
|
-
* **value**: a [number](/types/number) to set the game countdown by.
|
|
14
|
-
|
|
15
9
|
## Returns
|
|
16
10
|
|
|
17
11
|
* a [number](/types/number) that is the amount of time remaining for the game countdown in seconds.
|
package/libs/game/game.ts
CHANGED
|
@@ -372,6 +372,15 @@ namespace game {
|
|
|
372
372
|
_gameOverImpl(true, player);
|
|
373
373
|
}
|
|
374
374
|
|
|
375
|
+
function _mapScoreTypeToString(scoreType: ScoringType): string {
|
|
376
|
+
switch (scoreType) {
|
|
377
|
+
case ScoringType.HighScore: return "highscore";
|
|
378
|
+
case ScoringType.LowScore: return "lowscore";
|
|
379
|
+
case ScoringType.None: return "none";
|
|
380
|
+
default: return "none";
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
375
384
|
function _gameOverImpl(win: boolean, winnerOverride?: number) {
|
|
376
385
|
init();
|
|
377
386
|
if (__isOver) return;
|
|
@@ -389,7 +398,8 @@ namespace game {
|
|
|
389
398
|
const scores = playersWithScores.map(player => new GameOverPlayerScore(player.number, player.impl.score(), player === winner));
|
|
390
399
|
|
|
391
400
|
// Save all scores. Dependency Note: this action triggers Kiosk to exit the simulator and show the high score screen.
|
|
392
|
-
|
|
401
|
+
const scoreTypeString = _mapScoreTypeToString(goc.scoringType);
|
|
402
|
+
info.saveAllScores(scoreTypeString);
|
|
393
403
|
|
|
394
404
|
// Save high score if this was a judged game and there was a winner (don't save in the LOSE case).
|
|
395
405
|
if (judged && winner) {
|
package/libs/game/info.ts
CHANGED
|
@@ -241,7 +241,7 @@ namespace info {
|
|
|
241
241
|
return players ? players.filter(item => item.impl.hasScore()) : [];
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
-
export function saveAllScores() {
|
|
244
|
+
export function saveAllScores(scoringType: string) {
|
|
245
245
|
const allScoresKey = "all-scores";
|
|
246
246
|
let allScores: number[];
|
|
247
247
|
const pws = playersWithScores();
|
|
@@ -252,7 +252,12 @@ namespace info {
|
|
|
252
252
|
allScores = [];
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
|
|
255
|
+
const scoresObj = {
|
|
256
|
+
"allScores": allScores,
|
|
257
|
+
"scoringType": allScores.length ? scoringType : "None"
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
settings.writeJSON(allScoresKey, scoresObj);
|
|
256
261
|
}
|
|
257
262
|
|
|
258
263
|
export function winningPlayer(): PlayerInfo {
|
package/libs/game/tilemap.ts
CHANGED
|
@@ -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___P48913(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___49156 = (undefined);
|
|
70
|
+
globals._pollEventQueue___49169 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P48913.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"characterlcd.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P48913.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P48913_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P48913, 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___P48910_mk(s) {
|
|
|
88
88
|
|
|
89
89
|
const breakpoints = setupDebugger(1, [])
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return _main___P48913
|
|
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___P99077(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___99320 = (undefined);
|
|
70
|
+
globals._pollEventQueue___99333 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P99077.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"tsl2591.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P99077.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P99077_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P99077, 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___P99068_mk(s) {
|
|
|
88
88
|
|
|
89
89
|
const breakpoints = setupDebugger(1, [])
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return _main___P99077
|
|
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___P60221(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___60464 = (undefined);
|
|
70
|
+
globals._pollEventQueue___60477 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P60221.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"lora.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P60221.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P60221_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P60221, 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___P60218_mk(s) {
|
|
|
88
88
|
|
|
89
89
|
const breakpoints = setupDebugger(1, [])
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return _main___P60221
|
|
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___P192917(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___193160 = (undefined);
|
|
70
|
+
globals._pollEventQueue___193173 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P192917.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"keypad.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P192917.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P192917_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P192917, 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___P192896_mk(s) {
|
|
|
88
88
|
|
|
89
89
|
const breakpoints = setupDebugger(1, [])
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return _main___P192917
|
|
92
92
|
})
|
package/libs/mixer/sim/music.ts
CHANGED
|
@@ -54,16 +54,16 @@ namespace pxsim.music {
|
|
|
54
54
|
|
|
55
55
|
await res.sequencer.initAsync();
|
|
56
56
|
res.sequencer.addEventListener("stop", () => {
|
|
57
|
-
board().bus.queue(SEQUENCER_STOP_MESSAGE,
|
|
57
|
+
board().bus.queue(SEQUENCER_STOP_MESSAGE, res.id);
|
|
58
58
|
});
|
|
59
59
|
res.sequencer.addEventListener("state-change", () => {
|
|
60
|
-
board().bus.queue(SEQUENCER_STATE_CHANGE_MESSAGE,
|
|
60
|
+
board().bus.queue(SEQUENCER_STATE_CHANGE_MESSAGE, res.id);
|
|
61
61
|
});
|
|
62
62
|
res.sequencer.addEventListener("looped", () => {
|
|
63
|
-
board().bus.queue(SEQUENCER_LOOPED_MESSAGE,
|
|
63
|
+
board().bus.queue(SEQUENCER_LOOPED_MESSAGE, res.id);
|
|
64
64
|
});
|
|
65
65
|
res.sequencer.addEventListener("tick", () => {
|
|
66
|
-
board().bus.queue(SEQUENCER_TICK_MESSAGE,
|
|
66
|
+
board().bus.queue(SEQUENCER_TICK_MESSAGE, res.id);
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
|