pxt-common-packages 13.1.7 → 13.1.8
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 +7348 -7348
- package/libs/controller---none/built/debug/binary.js +7328 -7328
- 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-jsdoc-strings.json +1 -0
- package/libs/game/_locales/game-strings.json +1 -0
- package/libs/game/built/debug/binary.js +7267 -7267
- package/libs/game/docs/reference/sprites/sprite/follow.md +1 -0
- package/libs/game/docs/reference/sprites/sprite/set-kind.md +1 -1
- package/libs/game/docs/reference/sprites/sprite/unfollow.md +62 -0
- package/libs/game/sprite.ts +13 -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/mqtt/built/debug/binary.js +176 -176
- package/libs/net/built/debug/binary.js +176 -176
- package/libs/net-game/built/debug/binary.js +8984 -8984
- package/libs/palette/built/debug/binary.js +7266 -7266
- 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 +7266 -7266
- package/libs/storyboard/built/debug/binary.js +7266 -7266
- package/package.json +1 -1
|
@@ -55,7 +55,7 @@ namespace SpriteKind {
|
|
|
55
55
|
}
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
During the game, if you need a sprite to change to a different kind, say a ``Planet`` becomes an ``
|
|
58
|
+
During the game, if you need a sprite to change to a different kind, say a ``Planet`` becomes an ``Asteroid``, you just set the new kind with **setKind**.
|
|
59
59
|
|
|
60
60
|
## Example #example
|
|
61
61
|
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# unfollow
|
|
2
|
+
|
|
3
|
+
Stop a sprite from following any target sprite.
|
|
4
|
+
|
|
5
|
+
```sig
|
|
6
|
+
sprites.create(null).unfollow()
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
When you set a sprite to unfollow, it will stop moving toward any previously set target sprite. The sprite's velocity will be set to zero, and it will remain at its current position until you move it again using other methods.
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
Create 2 sprites. Set the second sprite to follow the first one. After 3 seconds, make the second sprite stop following.
|
|
14
|
+
|
|
15
|
+
```blocks
|
|
16
|
+
let mySprite = sprites.create(img`
|
|
17
|
+
. . . . . . . . . . . . . . . .
|
|
18
|
+
. . . . . . . . . . . . . . . .
|
|
19
|
+
. . . . . 7 7 7 7 7 7 . . . . .
|
|
20
|
+
. . . 7 7 7 7 7 7 7 7 7 7 . . .
|
|
21
|
+
. . . 7 7 7 7 7 7 7 7 7 7 . . .
|
|
22
|
+
. . 7 7 7 7 7 7 7 7 7 7 7 7 . .
|
|
23
|
+
. . 7 7 7 7 7 7 7 7 7 7 7 7 . .
|
|
24
|
+
. . 7 7 7 7 7 7 7 7 7 7 7 7 . .
|
|
25
|
+
. . 7 7 7 7 7 7 7 7 7 7 7 7 . .
|
|
26
|
+
. . 7 7 7 7 7 7 7 7 7 7 7 7 . .
|
|
27
|
+
. . 7 7 7 7 7 7 7 7 7 7 7 7 . .
|
|
28
|
+
. . . 7 7 7 7 7 7 7 7 7 7 . . .
|
|
29
|
+
. . . 7 7 7 7 7 7 7 7 7 7 . . .
|
|
30
|
+
. . . . . 7 7 7 7 7 7 . . . . .
|
|
31
|
+
. . . . . . . . . . . . . . . .
|
|
32
|
+
. . . . . . . . . . . . . . . .
|
|
33
|
+
`, SpriteKind.Player)
|
|
34
|
+
let mySprite2 = sprites.create(img`
|
|
35
|
+
. . . . . . . . . . . . . . . .
|
|
36
|
+
. . . . . . . . . . . . . . . .
|
|
37
|
+
. . . . . 5 5 5 5 5 5 . . . . .
|
|
38
|
+
. . . 5 5 5 5 5 5 5 5 5 5 . . .
|
|
39
|
+
. . . 5 5 5 5 5 5 5 5 5 5 . . .
|
|
40
|
+
. . 5 5 5 5 5 5 5 5 5 5 5 5 . .
|
|
41
|
+
. . 5 5 5 5 5 5 5 5 5 5 5 5 . .
|
|
42
|
+
. . 5 5 5 5 5 5 5 5 5 5 5 5 . .
|
|
43
|
+
. . 5 5 5 5 5 5 5 5 5 5 5 5 . .
|
|
44
|
+
. . 5 5 5 5 5 5 5 5 5 5 5 5 . .
|
|
45
|
+
. . 5 5 5 5 5 5 5 5 5 5 5 5 . .
|
|
46
|
+
. . . 5 5 5 5 5 5 5 5 5 5 . . .
|
|
47
|
+
. . . 5 5 5 5 5 5 5 5 5 5 . . .
|
|
48
|
+
. . . . . 5 5 5 5 5 5 . . . . .
|
|
49
|
+
. . . . . . . . . . . . . . . .
|
|
50
|
+
. . . . . . . . . . . . . . . .
|
|
51
|
+
`, SpriteKind.Player)
|
|
52
|
+
mySprite2.follow(mySprite, 50)
|
|
53
|
+
game.onUpdateInterval(1000, function () {
|
|
54
|
+
mySprite.setPosition(randint(0, scene.screenWidth()), randint(0, scene.screenHeight()))
|
|
55
|
+
})
|
|
56
|
+
pause(3000)
|
|
57
|
+
mySprite2.unfollow()
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## See also
|
|
61
|
+
|
|
62
|
+
[follow](/reference/sprites/sprite/follow)
|
package/libs/game/sprite.ts
CHANGED
|
@@ -1103,6 +1103,19 @@ class Sprite extends sprites.BaseSprite {
|
|
|
1103
1103
|
}
|
|
1104
1104
|
}
|
|
1105
1105
|
|
|
1106
|
+
/**
|
|
1107
|
+
* Stop this sprite from following any target sprite.
|
|
1108
|
+
*/
|
|
1109
|
+
//% group="Physics" weight=9
|
|
1110
|
+
//% blockId=spriteUnfollow
|
|
1111
|
+
//% block="set $sprite(myEnemy) unfollow"
|
|
1112
|
+
//% sprite.shadow=variables_get
|
|
1113
|
+
//% sprite.defl=myEnemy
|
|
1114
|
+
//% help=sprites/sprite/unfollow
|
|
1115
|
+
unfollow() {
|
|
1116
|
+
this.follow(null, 0);
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1106
1119
|
setScaleCore(sx?: number, sy?: number, anchor?: ScaleAnchor, proportional?: boolean): void {
|
|
1107
1120
|
anchor = anchor || ScaleAnchor.Middle;
|
|
1108
1121
|
|
|
@@ -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___P49369(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___49613 = (undefined);
|
|
70
|
+
globals._pollEventQueue___49626 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P49369.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"characterlcd.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P49369.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P49369_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P49369, depth: s.depth + 1,
|
|
82
82
|
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
|
|
83
83
|
} }
|
|
84
84
|
|
|
@@ -87,5 +87,5 @@ function _main___P49368_mk(s) {
|
|
|
87
87
|
|
|
88
88
|
const breakpoints = setupDebugger(1, [])
|
|
89
89
|
|
|
90
|
-
return
|
|
90
|
+
return _main___P49369
|
|
91
91
|
})
|
|
@@ -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___P100630(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___100874 = (undefined);
|
|
70
|
+
globals._pollEventQueue___100887 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P100630.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"tsl2591.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P100630.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P100630_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P100630, depth: s.depth + 1,
|
|
82
82
|
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
|
|
83
83
|
} }
|
|
84
84
|
|
|
@@ -87,5 +87,5 @@ function _main___P100627_mk(s) {
|
|
|
87
87
|
|
|
88
88
|
const breakpoints = setupDebugger(1, [])
|
|
89
89
|
|
|
90
|
-
return
|
|
90
|
+
return _main___P100630
|
|
91
91
|
})
|
|
@@ -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___P60652(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___60896 = (undefined);
|
|
70
|
+
globals._pollEventQueue___60909 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P60652.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"lora.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P60652.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P60652_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P60652, depth: s.depth + 1,
|
|
82
82
|
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
|
|
83
83
|
} }
|
|
84
84
|
|
|
@@ -87,5 +87,5 @@ function _main___P60651_mk(s) {
|
|
|
87
87
|
|
|
88
88
|
const breakpoints = setupDebugger(1, [])
|
|
89
89
|
|
|
90
|
-
return
|
|
90
|
+
return _main___P60652
|
|
91
91
|
})
|
|
@@ -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___P196988(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___197232 = (undefined);
|
|
70
|
+
globals._pollEventQueue___197245 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P196988.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"keypad.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P196988.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P196988_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P196988, depth: s.depth + 1,
|
|
82
82
|
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
|
|
83
83
|
} }
|
|
84
84
|
|
|
@@ -87,5 +87,5 @@ function _main___P196981_mk(s) {
|
|
|
87
87
|
|
|
88
88
|
const breakpoints = setupDebugger(1, [])
|
|
89
89
|
|
|
90
|
-
return
|
|
90
|
+
return _main___P196988
|
|
91
91
|
})
|