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
package/docs/skillmap/balloon.md
CHANGED
|
@@ -47,13 +47,23 @@
|
|
|
47
47
|
* type: tutorial
|
|
48
48
|
* description: Add a carnival character to pump up your balloon! Can you beat the clock?
|
|
49
49
|
* tags: easy, clicker, sprite, buttons
|
|
50
|
-
* next:
|
|
50
|
+
* next: balloon4
|
|
51
51
|
* url: /skillmap/balloon/balloon3
|
|
52
52
|
* imageUrl: /static/skillmap/balloon/balloon3.gif
|
|
53
53
|
* position: 1 2
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
57
|
+
### balloon4
|
|
58
|
+
* name: Two Player Party
|
|
59
|
+
* type: tutorial
|
|
60
|
+
* description: Remove your timer and add a second player to create a real-life competition!
|
|
61
|
+
* tags: easy, clicker, sprite, buttons, multiplayer
|
|
62
|
+
* next: balloon-cert
|
|
63
|
+
* url: /skillmap/balloon/balloon4
|
|
64
|
+
* imageUrl: /static/skillmap/balloon/balloon4.gif
|
|
65
|
+
* position: 2 2
|
|
66
|
+
|
|
57
67
|
|
|
58
68
|
### balloon-cert
|
|
59
69
|
* name: Congrats!
|
|
@@ -61,10 +71,10 @@
|
|
|
61
71
|
* type: certificate
|
|
62
72
|
* url: /static/skillmap/certificates/balloon-cert.pdf
|
|
63
73
|
* imageUrl: /static/skillmap/certificates/balloon-cert.png
|
|
64
|
-
*
|
|
65
|
-
* position: 2
|
|
74
|
+
* showMultiplayerShare: true
|
|
75
|
+
* position: 2 3
|
|
66
76
|
* actions:
|
|
67
|
-
* map: [
|
|
77
|
+
* map: [Try Whack-the-Mole](/skillmap/mole)
|
|
68
78
|
* editor: [Open in Creative Mode](/)
|
|
69
79
|
* rewards:
|
|
70
80
|
* certificate:
|
|
@@ -77,12 +87,3 @@
|
|
|
77
87
|
|
|
78
88
|
|
|
79
89
|
|
|
80
|
-
### balloon4
|
|
81
|
-
* name: Two Player Party (Optional)
|
|
82
|
-
* type: tutorial
|
|
83
|
-
* description: Remove your timer and add a second player to create a real-life competition!
|
|
84
|
-
* tags: easy, clicker, sprite, buttons, multiplayer
|
|
85
|
-
* url: /skillmap/balloon/balloon4
|
|
86
|
-
* imageUrl: /static/skillmap/balloon/balloon4.gif
|
|
87
|
-
* position: 2 3
|
|
88
|
-
|
|
@@ -6,7 +6,20 @@
|
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
~hint Click here view the intro video with ASL
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
hint~
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
Special thanks to MakeCode forum User _SoftTalker_ for this submission.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
Thank you to Deaf Kids Code for providing ASL video translations.
|
|
22
|
+

|
|
10
23
|
|
|
11
24
|
|
|
12
25
|
|
|
@@ -187,7 +200,7 @@ Let's get the mole jumping from hole to hole every second.
|
|
|
187
200
|
- :circle: From the ``||game: Game||`` category **in the toolbox**, grab <br/>
|
|
188
201
|
```blocks
|
|
189
202
|
game.onUpdateInterval(1000, function () {
|
|
190
|
-
sprites.
|
|
203
|
+
sprites.moveToRandomHoleOnGrid(myMole)
|
|
191
204
|
})
|
|
192
205
|
```
|
|
193
206
|
<br/>and drop it onto **an empty area** of the workspace.
|
|
@@ -218,7 +231,7 @@ hint~
|
|
|
218
231
|
|
|
219
232
|
```blocks
|
|
220
233
|
game.onUpdateInterval(1000, function () {
|
|
221
|
-
sprites.
|
|
234
|
+
sprites.moveToRandomHoleOnGrid(myMole)
|
|
222
235
|
})
|
|
223
236
|
```
|
|
224
237
|
|
|
@@ -252,100 +265,36 @@ When you're ready, click **Done** to return to the skillmap so you can add a rub
|
|
|
252
265
|
let myMole = sprites.create(img`.`, SpriteKind.Enemy)
|
|
253
266
|
|
|
254
267
|
game.onUpdateInterval(1000, function () {
|
|
255
|
-
sprites.
|
|
268
|
+
sprites.moveToRandomHoleOnGrid(myMole)
|
|
256
269
|
})
|
|
270
|
+
carnival.startCountdownGame(15, carnival.WinTypes.Score)
|
|
271
|
+
|
|
272
|
+
```
|
|
257
273
|
|
|
274
|
+
```ghost
|
|
275
|
+
carnival.startCountdownGame(15, carnival.WinTypes.Score)
|
|
258
276
|
```
|
|
259
277
|
|
|
260
278
|
|
|
261
279
|
```package
|
|
262
|
-
simple-blocks=github:microsoft/arcade-tutorial-extensions/simple-blocks
|
|
263
|
-
|
|
280
|
+
simple-blocks=github:microsoft/arcade-tutorial-extensions/simple-blocks
|
|
281
|
+
carnival=github:microsoft/arcade-carnival
|
|
264
282
|
```
|
|
265
283
|
|
|
266
|
-
|
|
267
284
|
```customts
|
|
268
285
|
|
|
269
|
-
|
|
270
|
-
//% block="win game"
|
|
271
|
-
Win,
|
|
272
|
-
//% block="lose game"
|
|
273
|
-
Lose,
|
|
274
|
-
//% block="high score"
|
|
275
|
-
Score,
|
|
276
|
-
//% block="multiplayer"
|
|
277
|
-
Multi
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
enum speeds {
|
|
281
|
-
//% block="fast"
|
|
282
|
-
Fast,
|
|
283
|
-
//% block="medium"
|
|
284
|
-
Med,
|
|
285
|
-
//% block="slow"
|
|
286
|
-
Slow
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
enum areas {
|
|
290
|
-
//% block="top"
|
|
291
|
-
Top,
|
|
292
|
-
//% block="middle"
|
|
293
|
-
Mid,
|
|
294
|
-
//% block="bottom"
|
|
295
|
-
Bottom
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
let textSprite: TextSprite = null
|
|
299
|
-
//let fanfare: effects.BackgroundEffect = undefined;
|
|
300
|
-
//let winStyle = winTypes.Score
|
|
301
|
-
|
|
302
|
-
|
|
286
|
+
namespace controller{
|
|
303
287
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
//% frameInterval.defl=100
|
|
312
|
-
//% group="Animate"
|
|
313
|
-
//% weight=100
|
|
314
|
-
//% help=animation/run-image-animation-hammer
|
|
315
|
-
export function runImageAnimationHammer(sprite: Sprite, frames: Image[], frameInterval?: number, loop?: boolean) {
|
|
316
|
-
const anim = new ImageAnimation(sprite, frames, frameInterval || 100, !!loop);
|
|
317
|
-
anim.init();
|
|
288
|
+
export enum Speeds {
|
|
289
|
+
//% block="fast"
|
|
290
|
+
Fast,
|
|
291
|
+
//% block="medium"
|
|
292
|
+
Med,
|
|
293
|
+
//% block="slow"
|
|
294
|
+
Slow
|
|
318
295
|
}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
296
|
|
|
322
297
|
|
|
323
|
-
namespace scene {
|
|
324
|
-
/**
|
|
325
|
-
* Adds text to the top, middle, or bottom
|
|
326
|
-
* of screen as defined by circuis games
|
|
327
|
-
*/
|
|
328
|
-
//% color="#4b6584"
|
|
329
|
-
//% blockId=add_label_to
|
|
330
|
-
//% block="add label $myLabel to $myPosition of window || $myColor"
|
|
331
|
-
//% myLabel.defl="Whack-the-Mole"
|
|
332
|
-
//% myColor.shadow="colorindexpicker"
|
|
333
|
-
//% myColor.defl=4
|
|
334
|
-
//% myPosition.defl=areas.Bottom
|
|
335
|
-
//% inlineInputMode=inline
|
|
336
|
-
export function add_label_to(myLabel: string, myPosition: areas, myColor?:number) {
|
|
337
|
-
if (!myColor)
|
|
338
|
-
myColor = 4;
|
|
339
|
-
|
|
340
|
-
textSprite = textsprite.create(myLabel, 0, myColor)
|
|
341
|
-
if (myPosition == areas.Bottom) textSprite.setPosition(80, 110);
|
|
342
|
-
if (myPosition == areas.Mid) textSprite.setPosition(80, 50);
|
|
343
|
-
if (myPosition == areas.Top) textSprite.setPosition(80, 20);
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
namespace controller{
|
|
348
|
-
|
|
349
298
|
/**
|
|
350
299
|
* Combines a simple "move with arrows"
|
|
351
300
|
* and stay in screen
|
|
@@ -353,13 +302,13 @@ namespace controller{
|
|
|
353
302
|
//% color="#d54322"
|
|
354
303
|
//% blockId=move_only_onscreen_with_arrows
|
|
355
304
|
//% block="move $thisSprite=variables_get(myHammer) on screen with speed $mySpeed"
|
|
356
|
-
//% mySpeed.defl=
|
|
305
|
+
//% mySpeed.defl=Speeds.Fast
|
|
357
306
|
//% inlineInputMode=inline
|
|
358
|
-
export function
|
|
307
|
+
export function moveOnlyOnscreenWithArrows(thisSprite: Sprite, mySpeed: Speeds) {
|
|
359
308
|
thisSprite.setStayInScreen(true)
|
|
360
|
-
if (mySpeed ==
|
|
309
|
+
if (mySpeed == Speeds.Fast) {
|
|
361
310
|
controller.moveSprite(thisSprite, 225, 225)
|
|
362
|
-
} else if (mySpeed ==
|
|
311
|
+
} else if (mySpeed == Speeds.Med) {
|
|
363
312
|
controller.moveSprite(thisSprite, 175, 175)
|
|
364
313
|
} else {
|
|
365
314
|
controller.moveSprite(thisSprite, 100, 100)
|
|
@@ -377,251 +326,17 @@ namespace sprites {
|
|
|
377
326
|
//% blockId=move_to_random_hole_on_grid
|
|
378
327
|
//% block="move sprite $thisSprite=variables_get(myMole) to random area"
|
|
379
328
|
//% inlineInputMode=inline
|
|
380
|
-
export function
|
|
329
|
+
export function moveToRandomHoleOnGrid(thisSprite: Sprite) {
|
|
381
330
|
thisSprite.setPosition(simplified.chooseRandomNumber(28, 80, 130), simplified.chooseRandomNumber(21, 53, 85))
|
|
331
|
+
simplified.still = 0;
|
|
382
332
|
}
|
|
383
333
|
}
|
|
384
334
|
|
|
385
|
-
namespace info {
|
|
386
|
-
let countdownInitialized = false;
|
|
387
|
-
/**
|
|
388
|
-
* Adds game end style to countdown
|
|
389
|
-
*/
|
|
390
|
-
//% color="#cf6a87"
|
|
391
|
-
//% group=countdown
|
|
392
|
-
//% blockId=start_countdown_game
|
|
393
|
-
//% block="start countdown $myTime (s) and game over $winType || effect $winEffect"
|
|
394
|
-
//% myTime.defl=15
|
|
395
|
-
//% winType.defl=winTypes.Score
|
|
396
|
-
//% winEffect.defl=effects.confetti
|
|
397
|
-
//% inlineInputMode=inline
|
|
398
|
-
export function startCountdownGame(myTime: number, winType: winTypes, winEffect?: effects.BackgroundEffect) {
|
|
399
|
-
if (!winType)
|
|
400
|
-
winType = winTypes.Win;
|
|
401
|
-
if (!winEffect && winType != winTypes.Lose){
|
|
402
|
-
winEffect = effects.confetti;
|
|
403
|
-
}
|
|
404
|
-
else { winEffect = effects.melt;}
|
|
405
|
-
init(winType, winEffect);
|
|
406
|
-
info.startCountdown(myTime)
|
|
407
|
-
|
|
408
|
-
}
|
|
409
335
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
// Prep default variables for different win types
|
|
413
|
-
let winnerNumber = 1;
|
|
414
|
-
let thisHigh = 0;
|
|
415
|
-
|
|
416
|
-
// Save all scores as relevant to the game.
|
|
417
|
-
info.saveAllScores();
|
|
418
|
-
|
|
419
|
-
// collect the scores before popping the scenes
|
|
420
|
-
const scoreInfo1 = info.player1.getState();
|
|
421
|
-
const scoreInfo2 = info.player2.getState();
|
|
422
|
-
const scoreInfo3 = info.player3.getState();
|
|
423
|
-
const scoreInfo4 = info.player4.getState();
|
|
424
|
-
const highScore = info.highScore();
|
|
425
|
-
const allScores = [scoreInfo1.score, scoreInfo2.score, scoreInfo3.score, scoreInfo4.score];
|
|
426
|
-
|
|
427
|
-
// Find player with highest score
|
|
428
|
-
for (let i = 0; i < 4; i++) {
|
|
429
|
-
if (allScores[i] > thisHigh) {
|
|
430
|
-
thisHigh = allScores[i];
|
|
431
|
-
winnerNumber = i+1;
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
// If highest score is higher than saved high, replace
|
|
435
|
-
if (thisHigh > highScore){
|
|
436
|
-
info.saveHighScore(); }
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
// releasing memory and clear fibers. Do not add anything that releases the fiber until background is set below,
|
|
440
|
-
// or screen will be cleared on the new frame and will not appear as background in the game over screen.
|
|
441
|
-
game.popScene();
|
|
442
|
-
game.pushScene();
|
|
443
|
-
scene.setBackgroundImage(screen.clone());
|
|
444
|
-
|
|
445
|
-
music.powerUp.play();
|
|
446
|
-
|
|
447
|
-
fanfare.startScreenEffect();
|
|
448
|
-
|
|
449
|
-
pause(400);
|
|
450
|
-
|
|
451
|
-
const overDialog = new GameOverDialog(true, thisHigh, highScore, winnerNumber, winStyle);
|
|
452
|
-
scene.createRenderable(scene.HUD_Z, target => {
|
|
453
|
-
overDialog.update();
|
|
454
|
-
target.drawTransparentImage(
|
|
455
|
-
overDialog.image,
|
|
456
|
-
0,
|
|
457
|
-
(screen.height - overDialog.image.height) >> 1
|
|
458
|
-
);
|
|
459
|
-
});
|
|
460
|
-
pause(500); // wait for users to stop pressing keys
|
|
461
|
-
overDialog.displayCursor();
|
|
462
|
-
game.waitAnyButton();
|
|
463
|
-
control.reset();
|
|
464
|
-
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
function init(winStyle: winTypes, fanfare: effects.BackgroundEffect) {
|
|
468
|
-
if (countdownInitialized) return;
|
|
469
|
-
countdownInitialized = true;
|
|
470
|
-
|
|
471
|
-
info.onCountdownEnd(function () {
|
|
472
|
-
if (winStyle == winTypes.Win) {
|
|
473
|
-
game.over(true, fanfare)
|
|
474
|
-
} else if (winStyle == winTypes.Lose) {
|
|
475
|
-
game.over(false, fanfare)
|
|
476
|
-
} else {
|
|
477
|
-
newGameOver(winStyle, fanfare);
|
|
478
|
-
}
|
|
479
|
-
})
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
export class GameOverDialog extends game.BaseDialog {
|
|
483
|
-
protected cursorOn: boolean;
|
|
484
|
-
protected isNewHighScore: boolean;
|
|
485
|
-
|
|
486
|
-
constructor(
|
|
487
|
-
protected win: boolean,
|
|
488
|
-
protected score?: number,
|
|
489
|
-
protected highScore?: number,
|
|
490
|
-
protected winnerNum?: number,
|
|
491
|
-
protected winStyle?: winTypes
|
|
492
|
-
) {
|
|
493
|
-
super(screen.width, 46, img`
|
|
494
|
-
1 1 1
|
|
495
|
-
f f f
|
|
496
|
-
1 1 1
|
|
497
|
-
`);
|
|
498
|
-
this.cursorOn = false;
|
|
499
|
-
this.isNewHighScore = this.score > this.highScore;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
displayCursor() {
|
|
503
|
-
this.cursorOn = true;
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
update() {
|
|
507
|
-
this.clearInterior();
|
|
508
|
-
this.drawTextCore();
|
|
509
|
-
|
|
510
|
-
if (this.cursorOn) {
|
|
511
|
-
this.drawCursorRow();
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
drawTextCore() {
|
|
516
|
-
const titleHeight = 8;
|
|
517
|
-
if (this.winStyle == winTypes.Multi){
|
|
518
|
-
this.image.printCenter(
|
|
519
|
-
"Player " + this.winnerNum + " wins!",
|
|
520
|
-
titleHeight,
|
|
521
|
-
screen.isMono ? 1 : 5,
|
|
522
|
-
image.font8
|
|
523
|
-
);
|
|
524
|
-
|
|
525
|
-
if (this.score !== undefined) {
|
|
526
|
-
const scoreHeight = 23;
|
|
527
|
-
const highScoreHeight = 34;
|
|
528
|
-
const scoreColor = screen.isMono ? 1 : 2;
|
|
529
|
-
|
|
530
|
-
this.image.printCenter(
|
|
531
|
-
"Score:" + this.score,
|
|
532
|
-
scoreHeight,
|
|
533
|
-
scoreColor,
|
|
534
|
-
image.font8
|
|
535
|
-
);
|
|
536
|
-
|
|
537
|
-
if (this.isNewHighScore) {
|
|
538
|
-
this.image.printCenter(
|
|
539
|
-
"New High Score!",
|
|
540
|
-
highScoreHeight,
|
|
541
|
-
scoreColor,
|
|
542
|
-
image.font5
|
|
543
|
-
);
|
|
544
|
-
} else {
|
|
545
|
-
this.image.printCenter(
|
|
546
|
-
"HI:" + this.highScore,
|
|
547
|
-
highScoreHeight,
|
|
548
|
-
scoreColor,
|
|
549
|
-
image.font8
|
|
550
|
-
);
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
else {
|
|
555
|
-
this.image.printCenter(
|
|
556
|
-
"Great Job!",
|
|
557
|
-
titleHeight,
|
|
558
|
-
screen.isMono ? 1 : 5,
|
|
559
|
-
image.font8
|
|
560
|
-
);
|
|
561
|
-
|
|
562
|
-
if (this.score !== undefined) {
|
|
563
|
-
const scoreHeight = 23;
|
|
564
|
-
const highScoreHeight = 34;
|
|
565
|
-
const scoreColor = screen.isMono ? 1 : 2;
|
|
566
|
-
|
|
567
|
-
this.image.printCenter(
|
|
568
|
-
"Score:" + this.score,
|
|
569
|
-
scoreHeight,
|
|
570
|
-
scoreColor,
|
|
571
|
-
image.font8
|
|
572
|
-
);
|
|
573
|
-
|
|
574
|
-
if (this.isNewHighScore) {
|
|
575
|
-
this.image.printCenter(
|
|
576
|
-
"New High Score!",
|
|
577
|
-
highScoreHeight,
|
|
578
|
-
scoreColor,
|
|
579
|
-
image.font5
|
|
580
|
-
);
|
|
581
|
-
} else {
|
|
582
|
-
this.image.printCenter(
|
|
583
|
-
"HI:" + this.highScore,
|
|
584
|
-
highScoreHeight,
|
|
585
|
-
scoreColor,
|
|
586
|
-
image.font8
|
|
587
|
-
);
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
}
|
|
336
|
+
namespace simplified {
|
|
594
337
|
|
|
595
|
-
|
|
596
|
-
/**
|
|
597
|
-
* Adds additional end game styles
|
|
598
|
-
*/
|
|
599
|
-
//% color="#8854d0"
|
|
600
|
-
//% group=Gameplay
|
|
601
|
-
//% blockId=on_game_over_expanded
|
|
602
|
-
//% block="game over $winStyle || add effect $winEffect"
|
|
603
|
-
//% winType.defl=winTypes.Win
|
|
604
|
-
//% winEffect.defl=effects.confetti
|
|
605
|
-
//% inlineInputMode=inline
|
|
606
|
-
export function onGameOverExpanded(winStyle: winTypes, winEffect?: effects.BackgroundEffect) {
|
|
607
|
-
if (!winStyle)
|
|
608
|
-
winStyle = winTypes.Win;
|
|
609
|
-
if (!winEffect && winStyle != winTypes.Lose) {
|
|
610
|
-
winEffect = effects.confetti;
|
|
611
|
-
}
|
|
612
|
-
else { winEffect = effects.melt; }
|
|
338
|
+
export let still = 0;
|
|
613
339
|
|
|
614
|
-
if (winStyle == winTypes.Win) {
|
|
615
|
-
game.over(true, winEffect)
|
|
616
|
-
} else if (winStyle == winTypes.Lose) {
|
|
617
|
-
game.over(false, winEffect)
|
|
618
|
-
} else {
|
|
619
|
-
info.newGameOver(winStyle, winEffect);
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
namespace simplified {
|
|
625
340
|
/**
|
|
626
341
|
* Randomly chooses one of the parameter numbers
|
|
627
342
|
*
|
|
@@ -648,14 +363,24 @@ namespace simplified {
|
|
|
648
363
|
return myList._pickRandom();
|
|
649
364
|
}
|
|
650
365
|
|
|
366
|
+
/**
|
|
367
|
+
* Checks to see if mole has been moved since last time position was checked
|
|
368
|
+
*/
|
|
651
369
|
|
|
370
|
+
//% blockId=check_mole_escape
|
|
371
|
+
//% block="check if mole has escaped"
|
|
372
|
+
export function checkMoleEscape () {
|
|
373
|
+
if (still == 1) {
|
|
374
|
+
info.player2.changeScoreBy(1)
|
|
375
|
+
}
|
|
376
|
+
still = 1
|
|
377
|
+
}
|
|
652
378
|
|
|
653
379
|
}
|
|
654
380
|
|
|
655
381
|
```
|
|
656
382
|
|
|
657
383
|
|
|
658
|
-
|
|
659
384
|
```assetjson
|
|
660
385
|
{
|
|
661
386
|
"README.md": " ",
|