pxt-common-packages 12.3.2 → 12.3.3

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 (39) hide show
  1. package/built/common-sim.d.ts +4 -0
  2. package/built/common-sim.js +275 -0
  3. package/libs/azureiot/built/debug/binary.js +461 -461
  4. package/libs/browser-events/browserEvents.ts +9 -9
  5. package/libs/color/built/debug/binary.js +8 -8
  6. package/libs/color-sensor/built/debug/binary.js +8 -8
  7. package/libs/controller/built/debug/binary.js +9969 -8494
  8. package/libs/controller---none/built/debug/binary.js +9948 -8473
  9. package/libs/datalogger/built/debug/binary.js +63 -63
  10. package/libs/edge-connector/built/debug/binary.js +8 -8
  11. package/libs/esp32/built/debug/binary.js +462 -462
  12. package/libs/game/_locales/game-strings.json +4 -0
  13. package/libs/game/built/debug/binary.js +9843 -8368
  14. package/libs/game/hitbox.ts +13 -9
  15. package/libs/game/pxt.json +1 -0
  16. package/libs/game/rotation.ts +194 -0
  17. package/libs/game/sprite.ts +102 -8
  18. package/libs/lcd/built/debug/binary.js +8 -8
  19. package/libs/light-spectrum-sensor/built/debug/binary.js +9 -9
  20. package/libs/lora/built/debug/binary.js +8 -8
  21. package/libs/matrix-keypad/built/debug/binary.js +8 -8
  22. package/libs/mqtt/built/debug/binary.js +176 -176
  23. package/libs/net/built/debug/binary.js +176 -176
  24. package/libs/net-game/built/debug/binary.js +11768 -10293
  25. package/libs/palette/built/debug/binary.js +9860 -8385
  26. package/libs/pixel/built/debug/binary.js +8 -8
  27. package/libs/power/built/debug/binary.js +8 -8
  28. package/libs/proximity/built/debug/binary.js +8 -8
  29. package/libs/radio/built/debug/binary.js +8 -8
  30. package/libs/radio-broadcast/built/debug/binary.js +8 -8
  31. package/libs/rotary-encoder/built/debug/binary.js +8 -8
  32. package/libs/screen/built/debug/binary.js +50 -50
  33. package/libs/screen/image.cpp +374 -0
  34. package/libs/screen/image.ts +42 -0
  35. package/libs/screen/sim/image.ts +406 -0
  36. package/libs/servo/built/debug/binary.js +8 -8
  37. package/libs/sprite-scaling/built/debug/binary.js +9860 -8385
  38. package/libs/storyboard/built/debug/binary.js +9860 -8385
  39. package/package.json +1 -1
@@ -4,8 +4,8 @@
4
4
  //% block="Browser Events"
5
5
  namespace browserEvents {
6
6
  export enum Event {
7
- PointerDown = 6858,
8
- PointerUp = 6857,
7
+ PointerDown = 6857,
8
+ PointerUp = 6858,
9
9
  PointerMove = 6859,
10
10
  PointerLeave = 6860,
11
11
  PointerEnter = 6861,
@@ -39,8 +39,8 @@ namespace browserEvents {
39
39
  protected releaseListeners: ((x: number, y: number) => void)[];
40
40
 
41
41
  constructor(public id: number) {
42
- control.internalOnEvent(Event.PointerDown, this.id, () => this.setPressed(false), 16);
43
- control.internalOnEvent(Event.PointerUp, this.id, () => this.setPressed(true), 16);
42
+ control.internalOnEvent(Event.PointerDown, this.id, () => this.setPressed(true), 16);
43
+ control.internalOnEvent(Event.PointerUp, this.id, () => this.setPressed(false), 16);
44
44
 
45
45
  this._pressed = false;
46
46
  this.pressListeners = [];
@@ -93,12 +93,12 @@ namespace browserEvents {
93
93
  //% block="pause until $this mouse button is $event"
94
94
  //% group="Mouse"
95
95
  //% weight=30
96
- pauseUntil(event: KeyEvent) {
96
+ pauseUntil(event: MouseButtonEvent) {
97
97
  control.waitForEvent(event, this.id)
98
98
  }
99
99
 
100
- addEventListener(event: KeyEvent, handler: (x: number, y: number) => void) {
101
- if (event === KeyEvent.Pressed) {
100
+ addEventListener(event: MouseButtonEvent, handler: (x: number, y: number) => void) {
101
+ if (event === MouseButtonEvent.Pressed) {
102
102
  this.pressListeners.push(handler);
103
103
  }
104
104
  else {
@@ -106,8 +106,8 @@ namespace browserEvents {
106
106
  }
107
107
  }
108
108
 
109
- removeEventListener(event: KeyEvent, handler: (x: number, y: number) => void) {
110
- if (event === KeyEvent.Pressed) {
109
+ removeEventListener(event: MouseButtonEvent, handler: (x: number, y: number) => void) {
110
+ if (event === MouseButtonEvent.Pressed) {
111
111
  this.pressListeners = this.pressListeners.filter(p => p !== handler);
112
112
  }
113
113
  else {
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
56
56
  const pxsim_numops = pxsim.numops;
57
57
 
58
58
 
59
- function _main___P138260(s) {
59
+ function _main___P141010(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._intervals___138503 = (undefined);
70
- globals._pollEventQueue___138516 = (undefined);
69
+ globals._intervals___141253 = (undefined);
70
+ globals._pollEventQueue___141266 = (undefined);
71
71
  r0 = undefined;
72
72
  return leave(s, r0)
73
73
  default: oops()
74
74
  } } }
75
- _main___P138260.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"colorbuffer.ts","functionName":"<main>","argumentNames":[]}
76
- _main___P138260.continuations = [ ]
75
+ _main___P141010.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"colorbuffer.ts","functionName":"<main>","argumentNames":[]}
76
+ _main___P141010.continuations = [ ]
77
77
 
78
- function _main___P138260_mk(s) {
78
+ function _main___P141010_mk(s) {
79
79
  checkStack(s.depth);
80
80
  return {
81
- parent: s, fn: _main___P138260, depth: s.depth + 1,
81
+ parent: s, fn: _main___P141010, 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___P138260_mk(s) {
88
88
 
89
89
  const breakpoints = setupDebugger(1, [])
90
90
 
91
- return _main___P138260
91
+ return _main___P141010
92
92
  })
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
56
56
  const pxsim_numops = pxsim.numops;
57
57
 
58
58
 
59
- function _main___P96566(s) {
59
+ function _main___P98630(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._intervals___96809 = (undefined);
70
- globals._pollEventQueue___96822 = (undefined);
69
+ globals._intervals___98873 = (undefined);
70
+ globals._pollEventQueue___98886 = (undefined);
71
71
  r0 = undefined;
72
72
  return leave(s, r0)
73
73
  default: oops()
74
74
  } } }
75
- _main___P96566.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"tcs34725.ts","functionName":"<main>","argumentNames":[]}
76
- _main___P96566.continuations = [ ]
75
+ _main___P98630.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"tcs34725.ts","functionName":"<main>","argumentNames":[]}
76
+ _main___P98630.continuations = [ ]
77
77
 
78
- function _main___P96566_mk(s) {
78
+ function _main___P98630_mk(s) {
79
79
  checkStack(s.depth);
80
80
  return {
81
- parent: s, fn: _main___P96566, depth: s.depth + 1,
81
+ parent: s, fn: _main___P98630, 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___P96566_mk(s) {
88
88
 
89
89
  const breakpoints = setupDebugger(1, [])
90
90
 
91
- return _main___P96566
91
+ return _main___P98630
92
92
  })