pxt-arcade 1.12.2 → 1.12.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.
- package/built/target.js +148 -143
- package/built/target.json +148 -143
- package/built/targetlight.json +5 -5
- package/built/theme.json +5 -0
- package/docs/SUMMARY.md +1 -0
- package/docs/hero-banner.md +6 -6
- package/docs/hour-of-code-2022-es.html +1 -1
- package/docs/hour-of-code-2022-pt.html +0 -1
- package/docs/hour-of-code-2022.html +15 -12
- package/docs/index-ref.json +1 -1
- package/docs/kiosk.html +1 -1
- package/docs/multiplayer.md +135 -0
- package/docs/projects/SUMMARY.md +3 -1
- package/docs/skillmap/balloon/balloon1.md +26 -312
- package/docs/skillmap/balloon/balloon2.md +18 -315
- package/docs/skillmap/balloon/balloon3.md +18 -317
- package/docs/skillmap/balloon/balloon4.md +105 -583
- package/docs/skillmap/balloon.md +14 -13
- package/docs/skillmap/mole/mole1.md +51 -326
- package/docs/skillmap/mole/mole2.md +43 -332
- package/docs/skillmap/mole/mole3.md +47 -316
- package/docs/{test/skillmap → skillmap}/mole/mole4.md +0 -0
- package/docs/skillmap/mole.md +14 -4
- package/docs/skillmap/turkey/turkey1.md +194 -127
- package/docs/skillmap/turkey/turkey2.md +144 -96
- package/docs/skillmap/turkey/turkey3.md +135 -84
- package/docs/skillmap/turkey.md +12 -10
- package/docs/skillmaps.md +24 -8
- package/docs/static/kiosk/asset-manifest.json +6 -6
- package/docs/static/kiosk/static/css/main.8897f977.css +2 -0
- package/docs/static/kiosk/static/css/main.8897f977.css.map +1 -0
- package/docs/static/kiosk/static/js/main.f11fd683.js +3 -0
- package/docs/static/kiosk/static/js/{main.01c7792a.js.LICENSE.txt → main.f11fd683.js.LICENSE.txt} +12 -32
- package/docs/static/kiosk/static/js/main.f11fd683.js.map +1 -0
- package/docs/static/multiplayer/help/emojis.png +0 -0
- package/docs/static/multiplayer/help/host-multiplayer.png +0 -0
- package/docs/static/multiplayer/help/hosted-game.png +0 -0
- package/docs/static/multiplayer/help/join-game.png +0 -0
- package/docs/static/multiplayer/help/joined-game.png +0 -0
- package/docs/static/multiplayer/help/share-button.png +0 -0
- package/docs/static/multiplayer/help/start-game.png +0 -0
- package/docs/static/skillmap/assets/dkc-logo-small.png +0 -0
- package/docs/static/tutorials/arrows/2pbg.png +0 -0
- package/docs/static/tutorials/arrows/key.png +0 -0
- package/docs/static/tutorials/arrows/p1.png +0 -0
- package/docs/static/tutorials/arrows/p2.png +0 -0
- package/docs/static/tutorials/horse/finish.png +0 -0
- package/docs/static/tutorials/horse/frame.png +0 -0
- package/docs/static/tutorials/horse/p1.png +0 -0
- package/docs/static/tutorials/horse/p2.png +0 -0
- package/docs/test/skillmap/balloon.md +1 -1
- package/docs/test/skillmap/dino/{collectort1.md → dino1.md} +135 -79
- package/docs/test/skillmap/dino/{collectort2.md → dino2.md} +0 -0
- package/docs/test/skillmap/dino/{collectort3.md → dino3.md} +0 -0
- package/docs/test/skillmap/dino/{collectort4.md → dino4.md} +0 -0
- package/docs/test/skillmap/dino/{collectort5.md → dino5.md} +0 -0
- package/docs/test/skillmap/dino.md +82 -0
- package/docs/test/skillmap/mole.md +1 -1
- package/docs/test/skillmap/turkey.md +1 -0
- package/docs/test/tutorials/arrow.md +677 -0
- package/docs/test/tutorials/debug.md +180 -0
- package/docs/test/tutorials/horse.md +456 -0
- package/docs/test/tutorials/hundred.md +417 -0
- package/docs/test/tutorials/target.md +6 -2
- package/docs/test/tutorials/wakanda-forever.md +191 -172
- package/docs/tutorials/arrow.md +677 -0
- package/docs/tutorials/horse.md +456 -0
- package/docs/{test/tutorials/target/target_copy.md → tutorials/target.md} +11 -1085
- package/docs/tutorials/wakanda-forever.md +3 -1
- package/package.json +2 -2
- package/docs/skillmap/turkey/turkey0.md +0 -197
- package/docs/skillmap/turkey/turkey1a.md +0 -308
- package/docs/skillmap/turkey/turkey2a.md +0 -277
- package/docs/skillmap/turkey/turkey3a.md +0 -219
- package/docs/static/kiosk/static/css/main.927f4dad.css +0 -2
- package/docs/static/kiosk/static/css/main.927f4dad.css.map +0 -1
- package/docs/static/kiosk/static/js/main.01c7792a.js +0 -3
- package/docs/static/kiosk/static/js/main.01c7792a.js.map +0 -1
- package/docs/test/skillmap/balloon/balloon1.md +0 -247
- package/docs/test/skillmap/balloon/balloon2.md +0 -377
- package/docs/test/skillmap/balloon/balloon3.md +0 -389
- package/docs/test/skillmap/balloon/balloon4.md +0 -385
- package/docs/test/skillmap/mole/mole1.md +0 -382
- package/docs/test/skillmap/mole/mole2.md +0 -422
- package/docs/test/skillmap/mole/mole3.md +0 -384
- package/docs/test/skillmap/turkey/turkey1.md +0 -338
- package/docs/test/skillmap/turkey/turkey2.md +0 -318
- package/docs/test/skillmap/turkey/turkey3.md +0 -265
|
@@ -82,7 +82,7 @@ hint~
|
|
|
82
82
|
|
|
83
83
|
#### ~ tutorialhint
|
|
84
84
|
```blocks
|
|
85
|
-
|
|
85
|
+
carnival.startCountdownGame(20, carnival.WinTypes.Lose)
|
|
86
86
|
scene.setBackgroundColor(1)
|
|
87
87
|
//@highlight
|
|
88
88
|
let myBalloon = sprites.create(assets.image`balloon-1`, SpriteKind.Player)
|
|
@@ -124,7 +124,7 @@ hint~
|
|
|
124
124
|
|
|
125
125
|
#### ~ tutorialhint
|
|
126
126
|
```blocks
|
|
127
|
-
|
|
127
|
+
carnival.startCountdownGame(20, carnival.WinTypes.Lose)
|
|
128
128
|
scene.setBackgroundColor(1)
|
|
129
129
|
let myBalloon = sprites.create(assets.image`balloon-1`, SpriteKind.Player)
|
|
130
130
|
//@highlight
|
|
@@ -209,7 +209,7 @@ let myBooth = sprites.create(img`.`, SpriteKind.Booth)
|
|
|
209
209
|
|
|
210
210
|
#### ~ tutorialhint
|
|
211
211
|
```blocks
|
|
212
|
-
|
|
212
|
+
carnival.startCountdownGame(20, carnival.WinTypes.Lose)
|
|
213
213
|
scene.setBackgroundColor(1)
|
|
214
214
|
let myBalloon = sprites.create(assets.image`balloon-1`, SpriteKind.Player)
|
|
215
215
|
myBalloon.setPosition(80, 93)
|
|
@@ -255,8 +255,8 @@ sprites.onOverlap(SpriteKind.Player, SpriteKind.Booth, function (sprite, otherSp
|
|
|
255
255
|
|
|
256
256
|
## {9. Game Over Win}
|
|
257
257
|
|
|
258
|
-
- :circle: From the ``||
|
|
259
|
-
``||
|
|
258
|
+
- :circle: From the ``||carnival: Carnival||`` category in the toolbox, grab <br/>
|
|
259
|
+
``||carnival: game over [multiplayer]||`` <br/>
|
|
260
260
|
and snap it into the empty
|
|
261
261
|
``||sprites(noclick): on overlaps||``
|
|
262
262
|
container already in the workspace.
|
|
@@ -278,7 +278,7 @@ let myBooth = sprites.create(img`.`, SpriteKind.Booth)
|
|
|
278
278
|
```blocks
|
|
279
279
|
sprites.onOverlap(SpriteKind.Player, SpriteKind.Booth, function (sprite, otherSprite) {
|
|
280
280
|
//@highlight
|
|
281
|
-
|
|
281
|
+
carnival.onGameOverExpanded(carnival.WinTypes.Multi)
|
|
282
282
|
})
|
|
283
283
|
```
|
|
284
284
|
|
|
@@ -317,21 +317,21 @@ When you're ready, click **Done** to return to the skillmap and continue buildin
|
|
|
317
317
|
|
|
318
318
|
```blockconfig.global
|
|
319
319
|
info.player1.changeScoreBy(1)
|
|
320
|
-
|
|
320
|
+
carnival.startCountdownGame(20, carnival.WinTypes.Lose)
|
|
321
321
|
let myBalloon = sprites.create(img`.`, SpriteKind.Player)
|
|
322
322
|
scene.setBackgroundColor(1)
|
|
323
323
|
myBalloon.setPosition(80, 93)
|
|
324
324
|
scaling.scaleByPixels(myBalloon, 1, ScaleDirection.Uniformly, ScaleAnchor.Bottom)
|
|
325
325
|
sprites.onOverlap(SpriteKind.Player, SpriteKind.Booth, function (sprite, otherSprite) { })
|
|
326
|
-
|
|
326
|
+
carnival.onGameOverExpanded(carnival.WinTypes.Multi)
|
|
327
327
|
```
|
|
328
328
|
|
|
329
329
|
|
|
330
330
|
|
|
331
331
|
```package
|
|
332
|
-
simple-blocks=github:microsoft/arcade-tutorial-extensions/simple-blocks/
|
|
333
|
-
arcade-text=github:microsoft/arcade-text/
|
|
334
332
|
pxt-sprite-scaling=github:microsoft/pxt-common-packages/libs/sprite-scaling
|
|
333
|
+
carnival=github:microsoft/arcade-carnival
|
|
334
|
+
simple-blocks=github:microsoft/arcade-tutorial-extensions/simple-blocks
|
|
335
335
|
```
|
|
336
336
|
|
|
337
337
|
|
|
@@ -341,322 +341,25 @@ controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
|
341
341
|
})
|
|
342
342
|
|
|
343
343
|
|
|
344
|
-
|
|
344
|
+
carnival.startCountdownGame(20, carnival.WinTypes.Lose)
|
|
345
345
|
scene.setBackgroundColor(1)
|
|
346
346
|
|
|
347
347
|
```
|
|
348
348
|
|
|
349
|
-
|
|
350
349
|
```customts
|
|
351
|
-
|
|
352
|
-
namespace SpriteKind {
|
|
353
|
-
//% isKind
|
|
354
|
-
export const Booth = SpriteKind.create()
|
|
355
|
-
//% isKind
|
|
356
|
-
export const Mouse = SpriteKind.create()
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
enum winTypes {
|
|
360
|
-
//% block="win game"
|
|
361
|
-
Win,
|
|
362
|
-
//% block="lose game"
|
|
363
|
-
Lose,
|
|
364
|
-
//% block="high score"
|
|
365
|
-
Score,
|
|
366
|
-
//% block="multiplayer"
|
|
367
|
-
Multi
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
enum speeds {
|
|
371
|
-
//% block="fast"
|
|
372
|
-
Fast,
|
|
373
|
-
//% block="medium"
|
|
374
|
-
Med,
|
|
375
|
-
//% block="slow"
|
|
376
|
-
Slow
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
enum areas {
|
|
380
|
-
//% block="top"
|
|
381
|
-
Top,
|
|
382
|
-
//% block="middle"
|
|
383
|
-
Mid,
|
|
384
|
-
//% block="bottom"
|
|
385
|
-
Bottom
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
let textSprite: TextSprite = null
|
|
389
|
-
//let fanfare: effects.BackgroundEffect = undefined;
|
|
390
|
-
//let winStyle = winTypes.Score
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
namespace scene {
|
|
350
|
+
namespace simplified{
|
|
395
351
|
/**
|
|
396
|
-
*
|
|
397
|
-
* of screen as defined by circuis games
|
|
352
|
+
* just run the code
|
|
398
353
|
*/
|
|
399
|
-
//%
|
|
400
|
-
//%
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
//% myColor.shadow="colorindexpicker"
|
|
404
|
-
//% myColor.defl=4
|
|
405
|
-
//% myPosition.defl=areas.Bottom
|
|
406
|
-
//% inlineInputMode=inline
|
|
407
|
-
export function add_label_to(myLabel: string, myPosition: areas, myColor?:number) {
|
|
408
|
-
if (!myColor)
|
|
409
|
-
myColor = 4;
|
|
410
|
-
|
|
411
|
-
textSprite = textsprite.create(myLabel, 0, myColor)
|
|
412
|
-
if (myPosition == areas.Bottom) textSprite.setPosition(80, 110);
|
|
413
|
-
if (myPosition == areas.Mid) textSprite.setPosition(80, 50);
|
|
414
|
-
if (myPosition == areas.Top) textSprite.setPosition(80, 20);
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
namespace info {
|
|
420
|
-
let countdownInitialized = false;
|
|
421
|
-
/**
|
|
422
|
-
* Adds game end style to countdown
|
|
423
|
-
*/
|
|
424
|
-
//% color="#cf6a87"
|
|
425
|
-
//% group=countdown
|
|
426
|
-
//% blockId=start_countdown_game
|
|
427
|
-
//% block="start countdown $myTime (s) and game over $winType || effect $winEffect"
|
|
428
|
-
//% myTime.defl=15
|
|
429
|
-
//% winType.defl=winTypes.Score
|
|
430
|
-
//% winEffect.defl=effects.confetti
|
|
431
|
-
//% inlineInputMode=inline
|
|
432
|
-
export function startCountdownGame(myTime: number, winType: winTypes, winEffect?: effects.BackgroundEffect) {
|
|
433
|
-
if (!winType)
|
|
434
|
-
winType = winTypes.Win;
|
|
435
|
-
if (!winEffect && winType != winTypes.Lose){
|
|
436
|
-
winEffect = effects.confetti;
|
|
437
|
-
}
|
|
438
|
-
else { winEffect = effects.melt;}
|
|
439
|
-
init(winType, winEffect);
|
|
440
|
-
info.startCountdown(myTime)
|
|
441
|
-
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
export function newGameOver(winStyle: winTypes, fanfare: effects.BackgroundEffect) {
|
|
445
|
-
|
|
446
|
-
// Prep default variables for different win types
|
|
447
|
-
let winnerNumber = 1;
|
|
448
|
-
let thisHigh = 0;
|
|
449
|
-
|
|
450
|
-
// Save all scores as relevant to the game.
|
|
451
|
-
info.saveAllScores();
|
|
452
|
-
|
|
453
|
-
// collect the scores before popping the scenes
|
|
454
|
-
const scoreInfo1 = info.player1.getState();
|
|
455
|
-
const scoreInfo2 = info.player2.getState();
|
|
456
|
-
const scoreInfo3 = info.player3.getState();
|
|
457
|
-
const scoreInfo4 = info.player4.getState();
|
|
458
|
-
const highScore = info.highScore();
|
|
459
|
-
const allScores = [scoreInfo1.score, scoreInfo2.score, scoreInfo3.score, scoreInfo4.score];
|
|
460
|
-
|
|
461
|
-
// Find player with highest score
|
|
462
|
-
for (let i = 0; i < 4; i++) {
|
|
463
|
-
if (allScores[i] > thisHigh) {
|
|
464
|
-
thisHigh = allScores[i];
|
|
465
|
-
winnerNumber = i+1;
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
// If highest score is higher than saved high, replace
|
|
469
|
-
if (thisHigh > highScore){
|
|
470
|
-
info.saveHighScore(); }
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
// releasing memory and clear fibers. Do not add anything that releases the fiber until background is set below,
|
|
474
|
-
// or screen will be cleared on the new frame and will not appear as background in the game over screen.
|
|
475
|
-
game.popScene();
|
|
476
|
-
game.pushScene();
|
|
477
|
-
scene.setBackgroundImage(screen.clone());
|
|
478
|
-
|
|
479
|
-
music.powerUp.play();
|
|
480
|
-
|
|
481
|
-
fanfare.startScreenEffect();
|
|
482
|
-
|
|
483
|
-
pause(400);
|
|
484
|
-
|
|
485
|
-
const overDialog = new GameOverDialog(true, thisHigh, highScore, winnerNumber, winStyle);
|
|
486
|
-
scene.createRenderable(scene.HUD_Z, target => {
|
|
487
|
-
overDialog.update();
|
|
488
|
-
target.drawTransparentImage(
|
|
489
|
-
overDialog.image,
|
|
490
|
-
0,
|
|
491
|
-
(screen.height - overDialog.image.height) >> 1
|
|
492
|
-
);
|
|
493
|
-
});
|
|
494
|
-
pause(500); // wait for users to stop pressing keys
|
|
495
|
-
overDialog.displayCursor();
|
|
496
|
-
game.waitAnyButton();
|
|
497
|
-
control.reset();
|
|
498
|
-
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
function init(winStyle: winTypes, fanfare: effects.BackgroundEffect) {
|
|
502
|
-
if (countdownInitialized) return;
|
|
503
|
-
countdownInitialized = true;
|
|
504
|
-
|
|
505
|
-
info.onCountdownEnd(function () {
|
|
506
|
-
if (winStyle == winTypes.Win) {
|
|
507
|
-
game.over(true, fanfare)
|
|
508
|
-
} else if (winStyle == winTypes.Lose) {
|
|
509
|
-
game.over(false, fanfare)
|
|
510
|
-
} else {
|
|
511
|
-
newGameOver(winStyle, fanfare);
|
|
512
|
-
}
|
|
513
|
-
})
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
export class GameOverDialog extends game.BaseDialog {
|
|
517
|
-
protected cursorOn: boolean;
|
|
518
|
-
protected isNewHighScore: boolean;
|
|
519
|
-
|
|
520
|
-
constructor(
|
|
521
|
-
protected win: boolean,
|
|
522
|
-
protected score?: number,
|
|
523
|
-
protected highScore?: number,
|
|
524
|
-
protected winnerNum?: number,
|
|
525
|
-
protected winStyle?: winTypes
|
|
526
|
-
) {
|
|
527
|
-
super(screen.width, 46, img`
|
|
528
|
-
1 1 1
|
|
529
|
-
f f f
|
|
530
|
-
1 1 1
|
|
531
|
-
`);
|
|
532
|
-
this.cursorOn = false;
|
|
533
|
-
this.isNewHighScore = this.score > this.highScore;
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
displayCursor() {
|
|
537
|
-
this.cursorOn = true;
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
update() {
|
|
541
|
-
this.clearInterior();
|
|
542
|
-
this.drawTextCore();
|
|
543
|
-
|
|
544
|
-
if (this.cursorOn) {
|
|
545
|
-
this.drawCursorRow();
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
drawTextCore() {
|
|
550
|
-
const titleHeight = 8;
|
|
551
|
-
if (this.winStyle == winTypes.Multi){
|
|
552
|
-
this.image.printCenter(
|
|
553
|
-
"Player " + this.winnerNum + " wins!",
|
|
554
|
-
titleHeight,
|
|
555
|
-
screen.isMono ? 1 : 5,
|
|
556
|
-
image.font8
|
|
557
|
-
);
|
|
558
|
-
|
|
559
|
-
if (this.score !== undefined) {
|
|
560
|
-
const scoreHeight = 23;
|
|
561
|
-
const highScoreHeight = 34;
|
|
562
|
-
const scoreColor = screen.isMono ? 1 : 2;
|
|
563
|
-
|
|
564
|
-
this.image.printCenter(
|
|
565
|
-
"Score:" + this.score,
|
|
566
|
-
scoreHeight,
|
|
567
|
-
scoreColor,
|
|
568
|
-
image.font8
|
|
569
|
-
);
|
|
570
|
-
|
|
571
|
-
if (this.isNewHighScore) {
|
|
572
|
-
this.image.printCenter(
|
|
573
|
-
"New High Score!",
|
|
574
|
-
highScoreHeight,
|
|
575
|
-
scoreColor,
|
|
576
|
-
image.font5
|
|
577
|
-
);
|
|
578
|
-
} else {
|
|
579
|
-
this.image.printCenter(
|
|
580
|
-
"HI:" + this.highScore,
|
|
581
|
-
highScoreHeight,
|
|
582
|
-
scoreColor,
|
|
583
|
-
image.font8
|
|
584
|
-
);
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
else {
|
|
589
|
-
this.image.printCenter(
|
|
590
|
-
"Great Job!",
|
|
591
|
-
titleHeight,
|
|
592
|
-
screen.isMono ? 1 : 5,
|
|
593
|
-
image.font8
|
|
594
|
-
);
|
|
595
|
-
|
|
596
|
-
if (this.score !== undefined) {
|
|
597
|
-
const scoreHeight = 23;
|
|
598
|
-
const highScoreHeight = 34;
|
|
599
|
-
const scoreColor = screen.isMono ? 1 : 2;
|
|
600
|
-
|
|
601
|
-
this.image.printCenter(
|
|
602
|
-
"Score:" + this.score,
|
|
603
|
-
scoreHeight,
|
|
604
|
-
scoreColor,
|
|
605
|
-
image.font8
|
|
606
|
-
);
|
|
607
|
-
|
|
608
|
-
if (this.isNewHighScore) {
|
|
609
|
-
this.image.printCenter(
|
|
610
|
-
"New High Score!",
|
|
611
|
-
highScoreHeight,
|
|
612
|
-
scoreColor,
|
|
613
|
-
image.font5
|
|
614
|
-
);
|
|
615
|
-
} else {
|
|
616
|
-
this.image.printCenter(
|
|
617
|
-
"HI:" + this.highScore,
|
|
618
|
-
highScoreHeight,
|
|
619
|
-
scoreColor,
|
|
620
|
-
image.font8
|
|
621
|
-
);
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
namespace game {
|
|
630
|
-
/**
|
|
631
|
-
* Adds additional end game styles
|
|
632
|
-
*/
|
|
633
|
-
//% color="#8854d0"
|
|
634
|
-
//% group=Gameplay
|
|
635
|
-
//% blockId=on_game_over_expanded
|
|
636
|
-
//% block="game over $winStyle || add effect $winEffect"
|
|
637
|
-
//% winType.defl=winTypes.Win
|
|
638
|
-
//% winEffect.defl=effects.confetti
|
|
639
|
-
//% inlineInputMode=inline
|
|
640
|
-
export function onGameOverExpanded(winStyle: winTypes, winEffect?: effects.BackgroundEffect) {
|
|
641
|
-
if (!winStyle)
|
|
642
|
-
winStyle = winTypes.Win;
|
|
643
|
-
if (!winEffect && winStyle != winTypes.Lose) {
|
|
644
|
-
winEffect = effects.confetti;
|
|
645
|
-
}
|
|
646
|
-
else { winEffect = effects.melt; }
|
|
647
|
-
|
|
648
|
-
if (winStyle == winTypes.Win) {
|
|
649
|
-
game.over(true, winEffect)
|
|
650
|
-
} else if (winStyle == winTypes.Lose) {
|
|
651
|
-
game.over(false, winEffect)
|
|
652
|
-
} else {
|
|
653
|
-
info.newGameOver(winStyle, winEffect);
|
|
654
|
-
}
|
|
354
|
+
//% block="create player"
|
|
355
|
+
//% handlerStatement=1
|
|
356
|
+
export function wrap(handler: () => void) {
|
|
357
|
+
handler();
|
|
655
358
|
}
|
|
656
359
|
}
|
|
657
|
-
|
|
658
360
|
```
|
|
659
361
|
|
|
362
|
+
|
|
660
363
|
```assetjson
|
|
661
364
|
{
|
|
662
365
|
"README.md": " ",
|