diff --git a/docs/skillmap/adventure.md b/docs/skillmap/adventure.md index 84e026804ab..28db95a8872 100644 --- a/docs/skillmap/adventure.md +++ b/docs/skillmap/adventure.md @@ -4,10 +4,10 @@ * infoUrl: skillmap/educator-info/adventure-info * bannerUrl: /static/skillmap/adventure/adventure3.gif * backgroundurl: /static/skillmap/backgrounds/adventure-comp.png -* primarycolor: #ffe19b -* secondarycolor: #ff8eca -* tertiarycolor: #b1dcef -* completednodecolor: #00224b +* primarycolor: #faeece +* secondarycolor: #8c281d +* tertiarycolor: #004b87 +* completednodecolor: #202c1b * highlightcolor: #ffffff * allowcodecarryover: true * tags: creative, intermediate, conditionals diff --git a/docs/skillmap/galaxy.md b/docs/skillmap/galaxy.md index 0c1c72443dd..44a5bc0bdd3 100644 --- a/docs/skillmap/galaxy.md +++ b/docs/skillmap/galaxy.md @@ -6,7 +6,7 @@ * backgroundurl: /static/skillmap/backgrounds/galaxy-comp1.png * primarycolor: #ffa000 * secondarycolor: #ff07d9 -* tertiarycolor: #ffffff +* tertiarycolor: #001122 * highlightcolor: #ffffff * completednodecolor: #31125d * tags: space, projectiles diff --git a/docs/skillmap/racer.md b/docs/skillmap/racer.md index 379edbd16ff..f02abe9c97d 100644 --- a/docs/skillmap/racer.md +++ b/docs/skillmap/racer.md @@ -7,7 +7,7 @@ * primarycolor: #fa8033 * secondarycolor: #fdf60c -* tertiarycolor: #000000 +* tertiarycolor: #020311 * strokecolor: #ffffff * highlightcolor: #ffffff * completednodecolor: #504c52 diff --git a/docs/skillmap/shark.md b/docs/skillmap/shark.md index 1892f4c8361..d01c5d4ffbc 100644 --- a/docs/skillmap/shark.md +++ b/docs/skillmap/shark.md @@ -6,7 +6,7 @@ * bannerurl: /static/skillmap/shark/shark4a.gif * primarycolor: #ff93c4 * secondarycolor: #87f2ff -* tertiarycolor: #5c406c +* tertiarycolor: #001538 * strokecolor: #5c406c * highlightcolor: #fff609 * completednodecolor: #473c4d diff --git a/docs/skillmap/sparks.md b/docs/skillmap/sparks.md index fe1e9f0cbf1..81b2c605620 100644 --- a/docs/skillmap/sparks.md +++ b/docs/skillmap/sparks.md @@ -6,7 +6,7 @@ * backgroundurl: /static/skillmap/backgrounds/sparks-comp.png * primarycolor: #bebebe * secondarycolor: #ffb200 -* tertiarycolor: #0e1b36 +* tertiarycolor: #0d1a36 * completednodecolor: #5f282a * highlightcolor: #ffff00 * allowcodecarryover: true diff --git a/docs/static/skillmap/backgrounds/adventure-comp.png b/docs/static/skillmap/backgrounds/adventure-comp.png index 12f7fbe5446..03b271dee7e 100644 Binary files a/docs/static/skillmap/backgrounds/adventure-comp.png and b/docs/static/skillmap/backgrounds/adventure-comp.png differ diff --git a/docs/static/skillmap/backgrounds/adventure-map.png b/docs/static/skillmap/backgrounds/adventure-map.png index ef28e2b6474..7fced71631f 100644 Binary files a/docs/static/skillmap/backgrounds/adventure-map.png and b/docs/static/skillmap/backgrounds/adventure-map.png differ diff --git a/docs/static/skillmap/backgrounds/galaxy-comp1.png b/docs/static/skillmap/backgrounds/galaxy-comp1.png index 8f4e49cb342..9a498f2fac7 100644 Binary files a/docs/static/skillmap/backgrounds/galaxy-comp1.png and b/docs/static/skillmap/backgrounds/galaxy-comp1.png differ diff --git a/docs/static/skillmap/backgrounds/galaxy-map.png b/docs/static/skillmap/backgrounds/galaxy-map.png index c8b587cff90..0e77aef6642 100644 Binary files a/docs/static/skillmap/backgrounds/galaxy-map.png and b/docs/static/skillmap/backgrounds/galaxy-map.png differ diff --git a/docs/static/skillmap/backgrounds/racer-comp.png b/docs/static/skillmap/backgrounds/racer-comp.png new file mode 100644 index 00000000000..bed0e52a51f Binary files /dev/null and b/docs/static/skillmap/backgrounds/racer-comp.png differ diff --git a/docs/static/skillmap/backgrounds/racer.png b/docs/static/skillmap/backgrounds/racer.png index e9b496f2332..8e541ba5855 100644 Binary files a/docs/static/skillmap/backgrounds/racer.png and b/docs/static/skillmap/backgrounds/racer.png differ diff --git a/docs/static/skillmap/backgrounds/shark-attack-bg.png b/docs/static/skillmap/backgrounds/shark-attack-bg.png index c1a0fe79000..f1c49c29bd5 100644 Binary files a/docs/static/skillmap/backgrounds/shark-attack-bg.png and b/docs/static/skillmap/backgrounds/shark-attack-bg.png differ diff --git a/docs/static/skillmap/backgrounds/shark-map.png b/docs/static/skillmap/backgrounds/shark-map.png index 3f4878cdb8b..88fb83c7b9c 100644 Binary files a/docs/static/skillmap/backgrounds/shark-map.png and b/docs/static/skillmap/backgrounds/shark-map.png differ diff --git a/docs/static/skillmap/backgrounds/sparks-comp.png b/docs/static/skillmap/backgrounds/sparks-comp.png index 83fdb43b719..39b6c694893 100644 Binary files a/docs/static/skillmap/backgrounds/sparks-comp.png and b/docs/static/skillmap/backgrounds/sparks-comp.png differ diff --git a/docs/static/skillmap/backgrounds/sparks-map.png b/docs/static/skillmap/backgrounds/sparks-map.png index e97f6596661..30ecd7465b1 100644 Binary files a/docs/static/skillmap/backgrounds/sparks-map.png and b/docs/static/skillmap/backgrounds/sparks-map.png differ diff --git a/docs/test/tutorials/chase-the-pizza.md b/docs/test/tutorials/chase-the-pizza.md index be7a7d801ee..fab61dd8c3c 100644 --- a/docs/test/tutorials/chase-the-pizza.md +++ b/docs/test/tutorials/chase-the-pizza.md @@ -18,11 +18,13 @@ before the time runs out! ## {Step 2} -**Start with a background color...** +**Set the background color** --- -- :tree: Open the ``||scene:Scene||`` toolbox drawer and drag
+- :tree: Open the
+``||scene:Scene||``
+toolbox drawer and drag
``||scene:set background color [ ]||``
into **the empty** ``||loops(noclick):on start||`` container already in your workspace. @@ -58,7 +60,16 @@ scene.setBackgroundColor(13) ## {Step 3} -Time to add a player **sprite**. +Add a player **sprite**. + +--- + +- :paper plane: Open the ``||sprites:Sprites||`` drawer and drag
+``||variables(sprites):set [mySprite] to sprite [ ] of kind [Player]||``
+into **the end of** the ``||loops(noclick):on start||`` block already in your workspace. + +--- + ~hint What's a sprite? πŸ’‘ @@ -73,13 +84,6 @@ Our player will be a sprite, too. hint~ ---- - -- :paper plane: Open the ``||sprites:Sprites||`` drawer and drag
-``||variables(sprites):set [mySprite] to sprite [ ] of kind [Player]||``
-into **the end of** the ``||loops(noclick):on start||`` block already in your workspace. - ---- ~hint Show me πŸ” @@ -103,7 +107,7 @@ mySprite = sprites.create(img`.`, SpriteKind.Player) block to open the **Sprite Editor**. -- :mouse pointer: Click **Done** when you are finished. +- :mouse pointer: Click **Done** when you are finished drawing. ~hint Show me πŸ” @@ -279,7 +283,7 @@ to open the **Sprite Editor**. ~hint Show me πŸ” -![Image gallery](/static/tutorials/chase-the-pizza/image-gallery.gif) +![Image gallery](/static/tutorials/chase-the-pizza/gallery.gif) hint~ @@ -425,7 +429,7 @@ hint~ --- - :paper plane: Open ``||sprites:Sprites||``, and drag
-``||sprites:set [pizza] position to||``
+``||sprites:set [pizza] position to...||``
into the **end of the**
``||sprites(noclick):on [sprite] ... overlaps [otherSprite]||``
container already in the workspace. @@ -448,14 +452,14 @@ sprites.onOverlap(SpriteKind.Player, SpriteKind.Food, function (sprite, otherSpr -## {Step 17} +## {Step 13} **Let’s start a countdown each time the sprites overlap.** --- - :id card: From ``||info:Info||``, drag
-``||info:start countdown [5] (s)||``
+``||info:start countdown [3] (s)||``
into the **end of the**
``||sprites(noclick):on [sprite] ... overlaps [otherSprite]||``
container already in the workspace. @@ -472,7 +476,7 @@ sprites.onOverlap(SpriteKind.Player, SpriteKind.Food, function (sprite, otherSpr info.changeScoreBy(1) pizza.setPosition(randint(0, scene.screenWidth()), randint(0, scene.screenHeight())) // @highlight - info.startCountdown(5) + info.startCountdown(3) }) ``` @@ -539,8 +543,7 @@ b 5 5 5 5 d d 4 4 4 4 . . . . . sprites.onOverlap(SpriteKind.Player, SpriteKind.Food, function (sprite, otherSprite) { info.changeScoreBy(1) pizza.setPosition(randint(0, scene.screenWidth()), randint(0, scene.screenHeight())) - // @highlight - info.startCountdown(10) + info.startCountdown(3) }) ``` @@ -552,7 +555,7 @@ scene.setBackgroundColor(13) sprites.onOverlap(SpriteKind.Player, SpriteKind.Food, function (sprite, otherSprite) {}) randint(0, scene.screenWidth()) pizza.setPosition(randint(0, scene.screenWidth()), randint(0, scene.screenHeight())) -info.startCountdown(5) +info.startCountdown(3) ``` diff --git a/docs/test/tutorials/lyla-jr.md b/docs/test/tutorials/lyla-jr.md index 67b78379758..c1b33174923 100644 --- a/docs/test/tutorials/lyla-jr.md +++ b/docs/test/tutorials/lyla-jr.md @@ -1,5 +1,6 @@ # Pickle Party ### @explicitHints true +### @flyoutOnly true ## Pickle Party Intro @showdialog @@ -42,7 +43,7 @@ You should see Lyla on the screen. ## {Step 5} -**Let's add pickles for them to chase!** +**Let's add pickles to chase!** ![Add a flying pickle with a new block](/static/tutorials/lyla/pickle.gif "Choose the pickle from the gallery" ) @@ -95,9 +96,8 @@ info.onScore2(15, function () {}) #### ~ tutorialhint ```blocks -info.onScore2(15, function () { - //@highlight - game.gameOver(true) +info.onScore2(5, function () { + game.simpleWin() }) ``` @@ -124,7 +124,7 @@ Grab the block that runs code when the game starts. ```blocks //@highlight -scene.setBackgroundImage(img`.`) +scene.setBG(`.`) ``` @@ -146,7 +146,7 @@ When you're ready, sign-in, then select **Done** to start an online multiplayer ```blockconfig.global info.onScore2(15, function () { }) -game.holdText("Press (A) when everyone is ready to start the game") +game.holdText("Press (A) to start") ``` @@ -157,12 +157,14 @@ game.onUpdateInterval2(1, function () { }) ```ghost -info.onScore2(15, function () { - game.gameOver(true) +loops.onStartSimple(function () { + scene.setBG(lyla_imgs.diner) + game.holdText("Press (A) to play") + music.simpleSong(music.createSong(lyla_imgs.countdown)) +}) +info.onScore2(5, function () { + game.simpleWin() }) -scene.setBackgroundImage(lyla_imgs.diner) -game.holdText("Press (A) when everyone is ready to start the game") -music.play(music.createSong(lyla_imgs.countdown), music.PlaybackMode.UntilDone) game.onUpdateInterval2(1, function () { sprites.sendFlying(lyla_imgs.picklechip) }) @@ -172,14 +174,16 @@ game.onUpdateInterval2(1, function () { ```package multiplayer -lyla_imgs=github:kiki-lee/lyla_imgs#v0.0.3 +arcade-text=github:microsoft/arcade-text#v1.3.0 +lyla_imgs=github:kiki-lee/lyla_imgs#v0.0.4 +arcade-block-icons=github:kiki-lee/arcade-block-icons#v0.0.10 ``` ```customts mp.onControllerEvent(ControllerEvent.Connected, function (thisPlayer) { if (mp.getPlayerProperty(thisPlayer, mp.PlayerProperty.Number) <= characters.length) { - pizza.setPlayersWith(characters, mp.getPlayerProperty(thisPlayer, mp.PlayerProperty.Number)) + pickle.setPlayersWith(characters, mp.getPlayerProperty(thisPlayer, mp.PlayerProperty.Number)) } }) sprites.onOverlap(SpriteKind.Player, SpriteKind.Projectile, function (sprite, otherSprite) { @@ -191,28 +195,66 @@ sprites.onOverlap(SpriteKind.Player, SpriteKind.Projectile, function (sprite, ot sprites.onOverlap(SpriteKind.Player, SpriteKind.Player, function (sprite, otherSprite) { if (mp.isButtonPressed(mp.getPlayerBySprite(sprite), mp.MultiplayerButton.A)) { scene.cameraShake(4, 500) - pizza.bumpSprite(sprite, otherSprite) + pickle.bumpSprite(sprite, otherSprite) mp.changePlayerStateBy(mp.getPlayerBySprite(otherSprite), MultiplayerState.score, -1) } if (mp.isButtonPressed(mp.getPlayerBySprite(otherSprite), mp.MultiplayerButton.A)) { scene.cameraShake(4, 500) - pizza.bumpSprite(otherSprite, sprite) + pickle.bumpSprite(otherSprite, sprite) mp.changePlayerStateBy(mp.getPlayerBySprite(sprite), MultiplayerState.score, -1) } }) let characters = [lyla_imgs.lyla, lyla_imgs.everett, lyla_imgs.stu] -pizza.setPlayersWith(characters, 1) +pickle.setPlayersWith(characters, 1) + + + +namespace loops{ + + + /** + * Run code when the play button is pressed + * (Like on start, but jr) + */ + //% color=#488898 + //% help=game/on-start-simple + //% weight=99 + //% afterOnStart=false + //% blockId=on_start_simple + //% block="on `ICON.play`" + //% blockAllowMultiple=0 + export function onStartSimple( a: () => void): void { + a(); + } +} + +namespace music{ + + /** + * Simplified block to play a song + */ + //% help=game/simple-song + //% blockId=playThis + //% block="play $thisSong" + //% thisSong.shadow=music_song_field_editor + export function simpleSong(thisSong: Playable) { + music.play(thisSong, music.PlaybackMode.UntilDone) + } +} + +//% weight=200 namespace game { /** * Run code on an interval of time. This executes before game.onUpdate() * @param body code to execute */ - //% group="Gameplay" //% help=game/on-update-interval weight=99 afterOnStart=true - //% blockId=gameinterval2 block="every $period second(s)" + //% blockId=gameinterval2 + //% weight=100 + //% block="every $period seconds" //% period.defl=1 //% blockAllowMultiple=1 export function onUpdateInterval2(period: number, a: () => void): void { @@ -229,18 +271,43 @@ namespace game { } + + //% blockId=hold_text + //% weight=200 + //% block="show $thisText" + //% thisText.defl="Press (A) to play" + export function holdText(thisText:string) { + game.showLongText(thisText, DialogLayout.Full) + } + - //% blockId=hold_text block="hold text $msg" - //% msg.defl = "Press (A) when everyone is ready to start the game" - //% img.shadow=screen_image_picker - export function holdText(msg: string) { - game.showLongText(msg, DialogLayout.Full) + /** + * Special lose sequence + */ + //% blockId=set_kindling_lose + //% block="game over `ICON.frown-open-white`" + //% help=github:docs/set_simple_lose + export function simpleLoss() { + game.gameOver(false) } + /** + * Special win sequence + */ + //% blockId=set_kindling_win + //% block="game over `ICON.smile-beam-white`" + //% weight=300 + //% help=github:docs/set_simple_win + export function simpleWin() { + game.gameOver(true) + } + } + +//% weight=300 namespace sprites { export enum Plyrs { @@ -260,12 +327,13 @@ namespace sprites { * Run code on an interval of time. This executes before game.onUpdate() * @param body code to execute */ - //% blockId=assign_player_image block="$thing = $img" + //% blockId=assign_player_image + //% block="$thing = $img" //% thing.defl = Plyrs.One //% img.shadow=screen_image_picker export function assignPlayerImg(thing: Plyrs, img:Image) { characters[thing] = img - pizza.setPlayersWith(characters, thing+1) + pickle.setPlayersWith(characters, thing+1) } @@ -273,7 +341,9 @@ namespace sprites { * Run code on an interval of time. This executes before game.onUpdate() * @param body code to execute */ - //% blockId=send_flying block="add flying $thing" + //% blockId=send_flying + //% weight=1000 + //% block="add flying $thing" //% thing.shadow=screen_image_picker export function sendFlying(thing:Image){ let projectile2 = sprites.createProjectileFromSide(thing, randint(-100, 100), randint(-100, 100)) @@ -282,11 +352,15 @@ namespace sprites { //% color=#b79900 icon="\uf1ce" -namespace pizza { +namespace pickle { // Make sure not to remove later player when earlier player tested export let playersConnected = 0; + // Create textsprite for score + export let scoreText = textsprite.create("") + + //% blockId=set_players //% block="set game for $num player(s) with $list" @@ -294,8 +368,8 @@ namespace pizza { //% list.shadow=variables_get //% list.defl=characters export function setPlayersWith(list: Image[], num: number) { - if (num >= pizza.playersConnected) { - pizza.playersConnected = num; + if (num >= pickle.playersConnected) { + pickle.playersConnected = num; sprites.destroyAllSpritesOfKind(SpriteKind.Player) let xloc = [ 40, @@ -318,7 +392,7 @@ namespace pizza { } } } - + //% blockId=bump_sprite //% block="$thisSprite bump $thatSprite" //% thisSprite.shadow=variables_get @@ -328,8 +402,72 @@ namespace pizza { export function bumpSprite(thisSprite: Sprite, thatSprite: Sprite) { thatSprite.setPosition((thisSprite.x + 80) % 160, thisSprite.y) } + + + /** + * Overrides the normal score UI with an iconified version + */ + //% blockId=mp_set_score_override + //% block="set $thisPlayer pickle to $thisScore" + //% thisPlayer.shadow=mp_playerSelector + //% thisScore.defl=0 + //% color="#b70082" + //% group="Info" + //% help=github:docs/mp_set_score_override + export function mpSetScoreOverride(thisPlayer: mp.Player, thisScore: number) { + + let thisIcon = img` + . . . b b . . . + . . b 5 5 b . . + . b 5 d 1 5 b . + . b 5 3 1 5 b . + . c 5 3 1 d c . + . c 5 1 d d c . + . . f d d f . . + . . . f f . . . + ` + + + if (pickle.playersConnected == 4) { + // show all four scores + } else if (pickle.playersConnected == 3) { + // show first three scores + } else if (pickle.playersConnected == 2) { + // show first two scores + } else { + mp.setPlayerState(thisPlayer, MultiplayerState.score, thisScore) + pickle.scoreText.setText("x" + convertToText(mp.getPlayerState(thisPlayer, MultiplayerState.score))) + scoreText.setIcon(thisIcon) + scoreText.setBorder(1, 2, 1) + scoreText.setMaxFontHeight(9) + scoreText.right = 160 + scoreText.top = 0 + scoreText.update() + info.showScore(false) + } + + } + + + /** + * Changes the score and overrides the traditional UI + * with an iconified version + */ + //% blockId=mp_change_score_override + //% block="change $thisPlayer pickle by $thisScore" + //% thisPlayer.shadow=mp_playerSelector + //% thisScore.defl=1 + //% color="#b70082" + //% help=github:docs/mp_change_score_override + export function mpChangeScoreOverride(thisPlayer: mp.Player, thisScore: number) { + mp.changePlayerStateBy(thisPlayer, MultiplayerState.score, thisScore) + pickle.mpSetScoreOverride(thisPlayer, info.score()) + } + + } +//% weight=250 namespace info { /** * Runs code once each time a player's score reaches a given value. @@ -337,7 +475,7 @@ namespace info { * @param handler The code to run when the score is reached */ //% blockId=mp_onScore2 - //% block="on player scores $score" + //% block="after $score `ICON.pickle`" //% score.defl=20 //% blockGap=8 //% help=multiplayer/on-score @@ -345,8 +483,39 @@ namespace info { export function onScore2(score: number, handler: () => void) { mp._mpstate().onReachedScore(score, handler); } + +} + +//% weight=100 +namespace scene { + /** + * Sets the background with fewer words + */ + //% blockId=set_bg + //% block="set scene $thisBG" + //% thisBG.shadow=lyla_bg_image_picker + //% help=docs/set_bg + export function setBG(thisBG: Image) { + scene.setBackgroundImage(thisBG) + } } +namespace images { + + //% blockId=lyla_bg_image_picker block="%img" + //% shim=TD_ID + //% img.fieldEditor="sprite" + //% img.fieldOptions.taggedTemplate="img" + //% img.fieldOptions.decompileIndirectFixedInstances="true" + //% img.fieldOptions.decompileArgumentAsString="true" + //% img.fieldOptions.sizes="-1,-1" + //% img.fieldOptions.filter="lylabg" + //% weight=100 group="Create" + //% blockHidden=1 duplicateShadowOnDrag + export function _screenImageLylaBG(img: Image) { + return img + } +} ``` ```simtheme