pxt-arcade 1.12.2 → 1.12.4

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 (103) hide show
  1. package/built/common-sim.d.ts +2 -2
  2. package/built/target.js +158 -146
  3. package/built/target.json +158 -146
  4. package/built/targetlight.json +5 -5
  5. package/built/theme.json +5 -0
  6. package/docs/SUMMARY.md +1 -0
  7. package/docs/hardware/adding.md +46 -52
  8. package/docs/hero-banner.md +8 -8
  9. package/docs/hour-of-code-2022-es.html +0 -1
  10. package/docs/hour-of-code-2022-pt.html +0 -1
  11. package/docs/hour-of-code-2022.html +12 -13
  12. package/docs/index-ref.json +1 -1
  13. package/docs/kiosk.html +1 -1
  14. package/docs/multiplayer.md +135 -0
  15. package/docs/projects/SUMMARY.md +3 -1
  16. package/docs/skillmap/balloon/balloon1.md +26 -312
  17. package/docs/skillmap/balloon/balloon2.md +18 -315
  18. package/docs/skillmap/balloon/balloon3.md +18 -317
  19. package/docs/skillmap/balloon/balloon4.md +105 -583
  20. package/docs/skillmap/balloon.md +14 -13
  21. package/docs/skillmap/mole/mole1.md +51 -326
  22. package/docs/skillmap/mole/mole2.md +43 -332
  23. package/docs/skillmap/mole/mole3.md +47 -316
  24. package/docs/{test/skillmap → skillmap}/mole/mole4.md +0 -0
  25. package/docs/skillmap/mole.md +14 -4
  26. package/docs/skillmap/turkey/turkey1.md +194 -127
  27. package/docs/skillmap/turkey/turkey2.md +144 -96
  28. package/docs/skillmap/turkey/turkey3.md +135 -84
  29. package/docs/skillmap/turkey.md +12 -10
  30. package/docs/skillmaps.md +24 -8
  31. package/docs/static/hero-gallery/holiday.png +0 -0
  32. package/docs/static/kiosk/asset-manifest.json +6 -6
  33. package/docs/static/kiosk/static/css/main.b60591be.css +2 -0
  34. package/docs/static/kiosk/static/css/main.b60591be.css.map +1 -0
  35. package/docs/static/kiosk/static/js/main.7c9f0b91.js +3 -0
  36. package/docs/static/kiosk/static/js/{main.01c7792a.js.LICENSE.txt → main.7c9f0b91.js.LICENSE.txt} +12 -32
  37. package/docs/static/kiosk/static/js/main.7c9f0b91.js.map +1 -0
  38. package/docs/static/multiplayer/help/emojis.png +0 -0
  39. package/docs/static/multiplayer/help/host-multiplayer.png +0 -0
  40. package/docs/static/multiplayer/help/hosted-game.png +0 -0
  41. package/docs/static/multiplayer/help/join-game.png +0 -0
  42. package/docs/static/multiplayer/help/joined-game.png +0 -0
  43. package/docs/static/multiplayer/help/share-button.png +0 -0
  44. package/docs/static/multiplayer/help/start-game.png +0 -0
  45. package/docs/static/skillmap/assets/dkc-logo-small.png +0 -0
  46. package/docs/static/tutorials/aliens/reload.png +0 -0
  47. package/docs/static/tutorials/arrows/2pbg.png +0 -0
  48. package/docs/static/tutorials/arrows/key.png +0 -0
  49. package/docs/static/tutorials/arrows/p1.png +0 -0
  50. package/docs/static/tutorials/arrows/p2.png +0 -0
  51. package/docs/static/tutorials/holiday/bgd.png +0 -0
  52. package/docs/static/tutorials/holiday/p1.png +0 -0
  53. package/docs/static/tutorials/holiday/p2.png +0 -0
  54. package/docs/static/tutorials/horse/finish.png +0 -0
  55. package/docs/static/tutorials/horse/frame.png +0 -0
  56. package/docs/static/tutorials/horse/p1.png +0 -0
  57. package/docs/static/tutorials/horse/p2.png +0 -0
  58. package/docs/test/courses/carnival.md +57 -0
  59. package/docs/test/courses/class-arcade.md +57 -0
  60. package/docs/test/skillmap/balloon.md +1 -1
  61. package/docs/test/skillmap/dino/{collectort1.md → dino1.md} +135 -79
  62. package/docs/test/skillmap/dino/{collectort2.md → dino2.md} +0 -0
  63. package/docs/test/skillmap/dino/{collectort3.md → dino3.md} +0 -0
  64. package/docs/test/skillmap/dino/{collectort4.md → dino4.md} +0 -0
  65. package/docs/test/skillmap/dino/{collectort5.md → dino5.md} +0 -0
  66. package/docs/test/skillmap/dino.md +82 -0
  67. package/docs/test/skillmap/mole.md +1 -1
  68. package/docs/test/skillmap/story/story1.md +8 -21
  69. package/docs/test/skillmap/story/story2.md +17 -28
  70. package/docs/test/skillmap/story/story3.md +51 -469
  71. package/docs/test/skillmap/story/story4.md +1 -2
  72. package/docs/test/skillmap/turkey.md +1 -0
  73. package/docs/test/tutorials/arrow.md +677 -0
  74. package/docs/test/tutorials/debug.md +180 -0
  75. package/docs/test/tutorials/holiday.md +609 -0
  76. package/docs/test/tutorials/horse.md +456 -0
  77. package/docs/test/tutorials/hundred.md +400 -0
  78. package/docs/test/tutorials/target.md +6 -2
  79. package/docs/test/tutorials/wakanda-forever.md +206 -147
  80. package/docs/tutorials/arrow.md +677 -0
  81. package/docs/tutorials/holiday.md +609 -0
  82. package/docs/tutorials/horse.md +456 -0
  83. package/docs/{test/tutorials/target/target_copy.md → tutorials/target.md} +11 -1085
  84. package/docs/tutorials/wakanda-forever.md +206 -147
  85. package/package.json +3 -3
  86. package/docs/skillmap/turkey/turkey0.md +0 -197
  87. package/docs/skillmap/turkey/turkey1a.md +0 -308
  88. package/docs/skillmap/turkey/turkey2a.md +0 -277
  89. package/docs/skillmap/turkey/turkey3a.md +0 -219
  90. package/docs/static/kiosk/static/css/main.927f4dad.css +0 -2
  91. package/docs/static/kiosk/static/css/main.927f4dad.css.map +0 -1
  92. package/docs/static/kiosk/static/js/main.01c7792a.js +0 -3
  93. package/docs/static/kiosk/static/js/main.01c7792a.js.map +0 -1
  94. package/docs/test/skillmap/balloon/balloon1.md +0 -247
  95. package/docs/test/skillmap/balloon/balloon2.md +0 -377
  96. package/docs/test/skillmap/balloon/balloon3.md +0 -389
  97. package/docs/test/skillmap/balloon/balloon4.md +0 -385
  98. package/docs/test/skillmap/mole/mole1.md +0 -382
  99. package/docs/test/skillmap/mole/mole2.md +0 -422
  100. package/docs/test/skillmap/mole/mole3.md +0 -384
  101. package/docs/test/skillmap/turkey/turkey1.md +0 -338
  102. package/docs/test/skillmap/turkey/turkey2.md +0 -318
  103. package/docs/test/skillmap/turkey/turkey3.md +0 -265
@@ -31,7 +31,7 @@ If your code doesn't work, start by looking to see if you can figure out what is
31
31
  ```blocks
32
32
 
33
33
  let myBalloon: Sprite = null
34
- info.startCountdownGame(20, winTypes.Score)
34
+ carnival.startCountdownGame(20, carnival.WinTypes.Lose)
35
35
  scene.setBackgroundColor(1)
36
36
 
37
37
  myBalloon = sprites.create(assets.image`balloon-1`, SpriteKind.Player)
@@ -45,7 +45,7 @@ controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
45
45
  })
46
46
 
47
47
  sprites.onOverlap(SpriteKind.Player, SpriteKind.Booth, function (sprite, otherSprite) {
48
- game.onGameOverExpanded(winTypes.Multi)
48
+ carnival.onGameOverExpanded(carnival.WinTypes.Multi)
49
49
  })
50
50
 
51
51
  ```
@@ -100,7 +100,7 @@ hint~
100
100
  ```blocks
101
101
  let myMouse: Sprite = null
102
102
  let myBalloon: Sprite = null
103
- info.startCountdownGame(20, winTypes.Score)
103
+ carnival.startCountdownGame(20, carnival.WinTypes.Lose)
104
104
 
105
105
  scene.setBackgroundColor(1)
106
106
  myBalloon = sprites.create(assets.image`balloon-1`, SpriteKind.Player)
@@ -277,9 +277,7 @@ controller.A.onEvent(ControllerButtonEvent.Released, function () {
277
277
 
278
278
  You've completed an amazing carnival game! Take some time to play it and appreciate what you've built.
279
279
 
280
- When you're ready, click **Done** to return to the skillmap and claim your **badge and certificate**.
281
-
282
- After you grab your rewards, you have the option to complete one more level to make your game a into a two-player race.
280
+ When you're ready, click **Done** to return to the skillmap to move on and make your game a into a two-player race.
283
281
 
284
282
  ```blockconfig.local
285
283
  let myMouse: Sprite = null
@@ -292,22 +290,22 @@ controller.A.onEvent(ControllerButtonEvent.Released, function () {
292
290
 
293
291
  ```blockconfig.global
294
292
  info.player1.changeScoreBy(1)
295
- info.startCountdownGame(20, winTypes.Score)
293
+ carnival.startCountdownGame(20, carnival.WinTypes.Lose)
296
294
  let myMouse = sprites.create(img`.`, SpriteKind.Mouse)
297
295
  scene.setBackgroundColor(1)
298
296
  myMouse.setPosition(80, 93)
299
297
  scaling.scaleByPixels(myBalloon, 1, ScaleDirection.Uniformly, ScaleAnchor.Bottom)
300
298
  sprites.onOverlap(SpriteKind.Player, SpriteKind.Booth, function (sprite, otherSprite) { })
301
- game.onGameOverExpanded(winTypes.Multi)
299
+ carnival.onGameOverExpanded(carnival.WinTypes.Multi)
302
300
  myMouse.setImage(img`.`)
303
301
 
304
302
  ```
305
303
 
306
304
 
307
-
308
305
  ```package
309
- arcade-text=github:microsoft/arcade-text/
310
306
  pxt-sprite-scaling=github:microsoft/pxt-common-packages/libs/sprite-scaling
307
+ carnival=github:microsoft/arcade-carnival
308
+ simple-blocks=github:microsoft/arcade-tutorial-extensions/simple-blocks
311
309
  ```
312
310
 
313
311
 
@@ -318,11 +316,11 @@ controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
318
316
  })
319
317
 
320
318
  sprites.onOverlap(SpriteKind.Player, SpriteKind.Booth, function (sprite, otherSprite) {
321
- game.onGameOverExpanded(winTypes.Multi)
319
+ carnival.onGameOverExpanded(carnival.WinTypes.Multi)
322
320
  })
323
321
 
324
322
  let myBalloon: Sprite = null
325
- info.startCountdownGame(20, winTypes.Score)
323
+ carnival.startCountdownGame(20, carnival.WinTypes.Lose)
326
324
  scene.setBackgroundColor(1)
327
325
 
328
326
  myBalloon = sprites.create(assets.image`balloon-1`, SpriteKind.Player)
@@ -341,7 +339,7 @@ controller.A.onEvent(ControllerButtonEvent.Released, function () {
341
339
  myMouse.setImage(assets.image`mouse1-up`)
342
340
  })
343
341
  sprites.onOverlap(SpriteKind.Player, SpriteKind.Booth, function (sprite, otherSprite) {
344
- game.onGameOverExpanded(winTypes.Multi)
342
+ carnival.onGameOverExpanded(carnival.WinTypes.Multi)
345
343
  })
346
344
  let myMouse: Sprite = null
347
345
  let myBalloon: Sprite = null
@@ -358,317 +356,20 @@ scaling.scaleByPixels_defl(myBalloon, 1, ScaleDirection.Uniformly, ScaleAnchor.B
358
356
  ```
359
357
 
360
358
 
361
-
362
359
  ```customts
363
-
364
- namespace SpriteKind {
365
- //% isKind
366
- export const Booth = SpriteKind.create()
367
- //% isKind
368
- export const Mouse = SpriteKind.create()
369
- }
370
-
371
- enum winTypes {
372
- //% block="win game"
373
- Win,
374
- //% block="lose game"
375
- Lose,
376
- //% block="high score"
377
- Score,
378
- //% block="multiplayer"
379
- Multi
380
- }
381
-
382
- enum speeds {
383
- //% block="fast"
384
- Fast,
385
- //% block="medium"
386
- Med,
387
- //% block="slow"
388
- Slow
389
- }
390
-
391
- enum areas {
392
- //% block="top"
393
- Top,
394
- //% block="middle"
395
- Mid,
396
- //% block="bottom"
397
- Bottom
398
- }
399
-
400
- let textSprite: TextSprite = null
401
- //let fanfare: effects.BackgroundEffect = undefined;
402
- //let winStyle = winTypes.Score
403
-
404
-
405
-
406
- namespace scene {
360
+ namespace simplified{
407
361
  /**
408
- * Adds text to the top, middle, or bottom
409
- * of screen as defined by circuis games
362
+ * just run the code
410
363
  */
411
- //% color="#4b6584"
412
- //% blockId=add_label_to
413
- //% block="add label $myLabel to $myPosition of window || $myColor"
414
- //% myLabel.defl="Whack-the-Mole"
415
- //% myColor.shadow="colorindexpicker"
416
- //% myColor.defl=4
417
- //% myPosition.defl=areas.Bottom
418
- //% inlineInputMode=inline
419
- export function add_label_to(myLabel: string, myPosition: areas, myColor?:number) {
420
- if (!myColor)
421
- myColor = 4;
422
-
423
- textSprite = textsprite.create(myLabel, 0, myColor)
424
- if (myPosition == areas.Bottom) textSprite.setPosition(80, 110);
425
- if (myPosition == areas.Mid) textSprite.setPosition(80, 50);
426
- if (myPosition == areas.Top) textSprite.setPosition(80, 20);
427
- }
428
- }
429
-
430
-
431
- namespace info {
432
- let countdownInitialized = false;
433
- /**
434
- * Adds game end style to countdown
435
- */
436
- //% color="#cf6a87"
437
- //% group=countdown
438
- //% blockId=start_countdown_game
439
- //% block="start countdown $myTime (s) and game over $winType || effect $winEffect"
440
- //% myTime.defl=15
441
- //% winType.defl=winTypes.Score
442
- //% winEffect.defl=effects.confetti
443
- //% inlineInputMode=inline
444
- export function startCountdownGame(myTime: number, winType: winTypes, winEffect?: effects.BackgroundEffect) {
445
- if (!winType)
446
- winType = winTypes.Win;
447
- if (!winEffect && winType != winTypes.Lose){
448
- winEffect = effects.confetti;
449
- }
450
- else { winEffect = effects.melt;}
451
- init(winType, winEffect);
452
- info.startCountdown(myTime)
453
-
454
- }
455
-
456
- export function newGameOver(winStyle: winTypes, fanfare: effects.BackgroundEffect) {
457
-
458
- // Prep default variables for different win types
459
- let winnerNumber = 1;
460
- let thisHigh = 0;
461
-
462
- // Save all scores as relevant to the game.
463
- info.saveAllScores();
464
-
465
- // collect the scores before popping the scenes
466
- const scoreInfo1 = info.player1.getState();
467
- const scoreInfo2 = info.player2.getState();
468
- const scoreInfo3 = info.player3.getState();
469
- const scoreInfo4 = info.player4.getState();
470
- const highScore = info.highScore();
471
- const allScores = [scoreInfo1.score, scoreInfo2.score, scoreInfo3.score, scoreInfo4.score];
472
-
473
- // Find player with highest score
474
- for (let i = 0; i < 4; i++) {
475
- if (allScores[i] > thisHigh) {
476
- thisHigh = allScores[i];
477
- winnerNumber = i+1;
478
- }
479
- }
480
- // If highest score is higher than saved high, replace
481
- if (thisHigh > highScore){
482
- info.saveHighScore(); }
483
-
484
-
485
- // releasing memory and clear fibers. Do not add anything that releases the fiber until background is set below,
486
- // or screen will be cleared on the new frame and will not appear as background in the game over screen.
487
- game.popScene();
488
- game.pushScene();
489
- scene.setBackgroundImage(screen.clone());
490
-
491
- music.powerUp.play();
492
-
493
- fanfare.startScreenEffect();
494
-
495
- pause(400);
496
-
497
- const overDialog = new GameOverDialog(true, thisHigh, highScore, winnerNumber, winStyle);
498
- scene.createRenderable(scene.HUD_Z, target => {
499
- overDialog.update();
500
- target.drawTransparentImage(
501
- overDialog.image,
502
- 0,
503
- (screen.height - overDialog.image.height) >> 1
504
- );
505
- });
506
- pause(500); // wait for users to stop pressing keys
507
- overDialog.displayCursor();
508
- game.waitAnyButton();
509
- control.reset();
510
-
511
- }
512
-
513
- function init(winStyle: winTypes, fanfare: effects.BackgroundEffect) {
514
- if (countdownInitialized) return;
515
- countdownInitialized = true;
516
-
517
- info.onCountdownEnd(function () {
518
- if (winStyle == winTypes.Win) {
519
- game.over(true, fanfare)
520
- } else if (winStyle == winTypes.Lose) {
521
- game.over(false, fanfare)
522
- } else {
523
- newGameOver(winStyle, fanfare);
524
- }
525
- })
526
- }
527
-
528
- export class GameOverDialog extends game.BaseDialog {
529
- protected cursorOn: boolean;
530
- protected isNewHighScore: boolean;
531
-
532
- constructor(
533
- protected win: boolean,
534
- protected score?: number,
535
- protected highScore?: number,
536
- protected winnerNum?: number,
537
- protected winStyle?: winTypes
538
- ) {
539
- super(screen.width, 46, img`
540
- 1 1 1
541
- f f f
542
- 1 1 1
543
- `);
544
- this.cursorOn = false;
545
- this.isNewHighScore = this.score > this.highScore;
546
- }
547
-
548
- displayCursor() {
549
- this.cursorOn = true;
550
- }
551
-
552
- update() {
553
- this.clearInterior();
554
- this.drawTextCore();
555
-
556
- if (this.cursorOn) {
557
- this.drawCursorRow();
558
- }
559
- }
560
-
561
- drawTextCore() {
562
- const titleHeight = 8;
563
- if (this.winStyle == winTypes.Multi){
564
- this.image.printCenter(
565
- "Player " + this.winnerNum + " wins!",
566
- titleHeight,
567
- screen.isMono ? 1 : 5,
568
- image.font8
569
- );
570
-
571
- if (this.score !== undefined) {
572
- const scoreHeight = 23;
573
- const highScoreHeight = 34;
574
- const scoreColor = screen.isMono ? 1 : 2;
575
-
576
- this.image.printCenter(
577
- "Score:" + this.score,
578
- scoreHeight,
579
- scoreColor,
580
- image.font8
581
- );
582
-
583
- if (this.isNewHighScore) {
584
- this.image.printCenter(
585
- "New High Score!",
586
- highScoreHeight,
587
- scoreColor,
588
- image.font5
589
- );
590
- } else {
591
- this.image.printCenter(
592
- "HI:" + this.highScore,
593
- highScoreHeight,
594
- scoreColor,
595
- image.font8
596
- );
597
- }
598
- }
599
- }
600
- else {
601
- this.image.printCenter(
602
- "Great Job!",
603
- titleHeight,
604
- screen.isMono ? 1 : 5,
605
- image.font8
606
- );
607
-
608
- if (this.score !== undefined) {
609
- const scoreHeight = 23;
610
- const highScoreHeight = 34;
611
- const scoreColor = screen.isMono ? 1 : 2;
612
-
613
- this.image.printCenter(
614
- "Score:" + this.score,
615
- scoreHeight,
616
- scoreColor,
617
- image.font8
618
- );
619
-
620
- if (this.isNewHighScore) {
621
- this.image.printCenter(
622
- "New High Score!",
623
- highScoreHeight,
624
- scoreColor,
625
- image.font5
626
- );
627
- } else {
628
- this.image.printCenter(
629
- "HI:" + this.highScore,
630
- highScoreHeight,
631
- scoreColor,
632
- image.font8
633
- );
634
- }
635
- }
636
- }
637
- }
638
- }
639
- }
640
-
641
- namespace game {
642
- /**
643
- * Adds additional end game styles
644
- */
645
- //% color="#8854d0"
646
- //% group=Gameplay
647
- //% blockId=on_game_over_expanded
648
- //% block="game over $winStyle || add effect $winEffect"
649
- //% winType.defl=winTypes.Win
650
- //% winEffect.defl=effects.confetti
651
- //% inlineInputMode=inline
652
- export function onGameOverExpanded(winStyle: winTypes, winEffect?: effects.BackgroundEffect) {
653
- if (!winStyle)
654
- winStyle = winTypes.Win;
655
- if (!winEffect && winStyle != winTypes.Lose) {
656
- winEffect = effects.confetti;
657
- }
658
- else { winEffect = effects.melt; }
659
-
660
- if (winStyle == winTypes.Win) {
661
- game.over(true, winEffect)
662
- } else if (winStyle == winTypes.Lose) {
663
- game.over(false, winEffect)
664
- } else {
665
- info.newGameOver(winStyle, winEffect);
666
- }
364
+ //% block="create player"
365
+ //% handlerStatement=1
366
+ export function wrap(handler: () => void) {
367
+ handler();
667
368
  }
668
369
  }
669
-
670
370
  ```
671
371
 
372
+
672
373
  ```assetjson
673
374
  {
674
375
  "README.md": " ",