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.
- package/built/common-sim.d.ts +2 -2
- package/built/target.js +158 -146
- package/built/target.json +158 -146
- package/built/targetlight.json +5 -5
- package/built/theme.json +5 -0
- package/docs/SUMMARY.md +1 -0
- package/docs/hardware/adding.md +46 -52
- package/docs/hero-banner.md +8 -8
- package/docs/hour-of-code-2022-es.html +0 -1
- package/docs/hour-of-code-2022-pt.html +0 -1
- package/docs/hour-of-code-2022.html +12 -13
- 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/hero-gallery/holiday.png +0 -0
- package/docs/static/kiosk/asset-manifest.json +6 -6
- package/docs/static/kiosk/static/css/main.b60591be.css +2 -0
- package/docs/static/kiosk/static/css/main.b60591be.css.map +1 -0
- package/docs/static/kiosk/static/js/main.7c9f0b91.js +3 -0
- package/docs/static/kiosk/static/js/{main.01c7792a.js.LICENSE.txt → main.7c9f0b91.js.LICENSE.txt} +12 -32
- package/docs/static/kiosk/static/js/main.7c9f0b91.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/aliens/reload.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/holiday/bgd.png +0 -0
- package/docs/static/tutorials/holiday/p1.png +0 -0
- package/docs/static/tutorials/holiday/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/courses/carnival.md +57 -0
- package/docs/test/courses/class-arcade.md +57 -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/story/story1.md +8 -21
- package/docs/test/skillmap/story/story2.md +17 -28
- package/docs/test/skillmap/story/story3.md +51 -469
- package/docs/test/skillmap/story/story4.md +1 -2
- 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/holiday.md +609 -0
- package/docs/test/tutorials/horse.md +456 -0
- package/docs/test/tutorials/hundred.md +400 -0
- package/docs/test/tutorials/target.md +6 -2
- package/docs/test/tutorials/wakanda-forever.md +206 -147
- package/docs/tutorials/arrow.md +677 -0
- package/docs/tutorials/holiday.md +609 -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 +206 -147
- package/package.json +3 -3
- 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
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
319
|
+
carnival.onGameOverExpanded(carnival.WinTypes.Multi)
|
|
322
320
|
})
|
|
323
321
|
|
|
324
322
|
let myBalloon: Sprite = null
|
|
325
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
409
|
-
* of screen as defined by circuis games
|
|
362
|
+
* just run the code
|
|
410
363
|
*/
|
|
411
|
-
//%
|
|
412
|
-
//%
|
|
413
|
-
|
|
414
|
-
|
|
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": " ",
|