From b4460a4a8f76d26a914e4347c87690ebf1514083 Mon Sep 17 00:00:00 2001 From: Kiki Date: Tue, 5 Nov 2024 11:03:19 -0800 Subject: [PATCH] Lyla changes --- docs/static/tutorials/lyla/key.png | Bin 0 -> 20569 bytes docs/test/tutorials/lyla-jr.md | 645 ++++++++++++++++------------- docs/tutorials/lyla-jr.md | 84 ++-- 3 files changed, 414 insertions(+), 315 deletions(-) create mode 100644 docs/static/tutorials/lyla/key.png diff --git a/docs/static/tutorials/lyla/key.png b/docs/static/tutorials/lyla/key.png new file mode 100644 index 0000000000000000000000000000000000000000..433e1018152111f0f8a773aa78dd84ba8c039881 GIT binary patch literal 20569 zcmZU41yoc~_wOYH1eB1HF6mB@6hT6228q23UU(9Pzg~X2zn+ZDW(WPa75sT5CtCWDSGi~4E%ZeO;X(k zg3w<4`+o+ZKCvO26lJGO@k5=kr`F#8cz}* zN)IbwE6U-?fUo<)eg~_EH%<{?e-U16Hg^>qu(DL-Muquy_A;%uNHWyoIaMPo^Xx7i zCY7#lsVed)>M$`%C8BvD-T8oC7}Lm2SEvR$BCl=lw|m(~{4HW?4NE;ZrQznto0rpC zs^ihp`JR%e^2iMcNMwd>!b@n5--Xo+x6ar5eZHoTVw^X zPnsK^C7Nyhd9EoLi>0&h>4^`7GUA)34)ekM?gi=1CdB;Mtf$g9Kb@4TxMtC7o)3I83Mb>K=Q+55g2m={ap5!FLn;cv!KE>Owkj9Qcopg?Lc7+KwxMCA?v=KY zl-4=WLm@)*%sRT`y03#WZ$Chj@%>n^C=_G!?g`>7r%y{R{}W9XWAmoS;!#Fv=h`>T zql{lfwKAdu%D1i3z+7U&`(Vm&lGSjji=;FvE(~8C-qSWUJ4Fksm87@vrXxRlhQZ@X zNFjpaC+0bx8Jj}qH7F@3b=_>AnV6Ty&VDD+Q(BHhqa<03<^#idHF}mB&t)Q-tGrle zm!Fmf4<#fd{I#ytV!;pSfD{xJe@914jB!DZj*hm6iwmu-t$&v~_zBj^%F4cfhc8tl zCM9JF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*{0VXgaITWKN8WTK34$aX0UH zyE@1FcPXo@zf@gE0pfOXO<7r4T3T8|L&G1tb^$ZXp2r;K-?+&p!V0L-Dp$6ahd8o@*`}8&ou-D9!FMOjC-YDB85ALh9tGi7mTX zQABIf^uLdvofOyO(Wo%sK~aa&(hjAi0YGeY^xQdfIFFx&jOzN0XEMjfhL7&i9TSpU zR=)iBS&L#KnB^HqP*`|>)|@#2;4AliH#ODW-PDmi&bIF36y2R$3@$2`&6q2SNiZv3 z3`k<;_`2#!M#Z`n`o{?Yw;6NHHGmz?H)b&%ay6rN-AX$p4z4riB9n8{n4c(v+qP(f zuVz&9{u|rr<}J3Xm$x76D5s8r!5w&Pj4=!BzAB{CDN2x&=@{z>Z3opYmN_czYqp zFg?U#bG^i~ltl*Xel*5XF<;ocnkK{yQB{?XjEXQ| z1|b$3z|el=1OUj$&$JmMqaw`BNtWD0$bhJ*s`AlM;ReH7iM@9rF$uPw35~DC)QMwV zN{UEDsksG(DWbwO#^t5XC54M7JlZ;S&@BA3*np;XBPR-DQAMe=q%d{jSUZ}LI&rMD zq)=2*YF0_bQcP)!ipH2!l)9D_rA{1Yt)cn}u?ni46i{H$H-~{hKo}P(2eNONwE-^! z0rg%;29b)zqoN`fO&A*$)Z(#1-|M)!25|1K#!4PgZ#No@y1ii_fPwJm?dCy|6PTzd zXa^g#n?<|I;toR_&j4QzdE3~(*(^uyHo(+YGEwhi)82JuV=cKj=w_e_V}y`M?1JSYPPou)tnGvoseg8Zrc6U8^hYsMtkY1on)xKe-@^`!`?9*A%p+|Z2V1305A|j2n7^Eh!Dao5vOU))CL)M zl7uFJz=1*tC;(7l3YQx-fNRvj sw0AU$(&_CJ#PC4SxmFws2=LAS2bQ4~`)}@ playersConnected) { + playersConnected = num; + pickles_to_get = 7 * num; + sprites.destroyAllSpritesOfKind(SpriteKind.Player) + let xloc = [ + 40, + 120, + 40, + 120 + ] + let yloc = [ + 30, + 30, + 90, + 90 + ] + for (let index = 0; index <= num - 1; index++) { + mp.setPlayerSprite(mp.getPlayerByIndex(index), sprites.create(list[index], SpriteKind.Player)) + mp.getPlayerSprite(mp.getPlayerByIndex(index)).setStayInScreen(true) + mp.getPlayerSprite(mp.getPlayerByIndex(index)).setPosition(xloc.shift(), yloc.shift()) + mp.getPlayerSprite(mp.getPlayerByIndex(index)).z = 1000 + mp.moveWithButtons(mp.getPlayerByIndex(index)) + + } + game.splashMP("Catch " + pickles_to_get + theseThings + " to win!") + } + } + //% blockId=bump_sprite + // block="$thisSprite bump $thatSprite" + //% thisSprite.shadow=variables_get + //% thisSprite.defl=sprite + //% thatSprite.shadow=variables_get + //% thatSprite.defl=otherSprite + 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=set_score_override + //% block="set `ICON.pickle` to $thisScore" + //% thisScore.defl=0 + //% color="#b70082" + //% group="Info" + //% help=github:docs/mp_set_score_override + export function setScoreOverride(thisScore: number) { + let thisIcon = img` + . . . . . . . . . . . . . . . . +. . . . . 7 7 a 8. . . . . . . +. . . . 7 7 a 8 7 7 a 8 7. . . +. . . 7 7 a 8 7 7 a 8 7 7 7. . +. . 7 7 a 8 7 7 a 8 7 7 7 a 8. +. . 7 a 8 7 7 a 8 7 7 7 a 8 7. +. 7 a 8 7 7 a 8 7 7 7 a 8 7. . +.a 8 7 7 a 8 7 7 7 a 8 7 7 7. +. . 7 7 a 8 7 7 a 8 8 7 7 7 7. +. . 7 a 8 7 7 a 8 7 7 7 7 7 a. +. . . 8 7 7 a 8 7 7 7 7 7 a 8. +. . . 7 7 a 8 7 7 7 7 a a 8. . +. . . .a 8 7 7 7 7 a 8 7. . . +. . . . . . 7 7 7 a 8 7. . . . +. . . . . . . . . . . . . . . . +. . . . . . . . . . . . . . . . +` + info.setScore(thisScore) + pickle.scoreText.setText(" x " + convertToText(info.score())) + scoreText.setIcon(thisIcon) + scoreText.setBorder(1, 3, 1) + scoreText.setMaxFontHeight(9) + scoreText.right = 160 + scoreText.top = 1 + scoreText.update() + info.showScore(false) + } + /** + * Changes the score and overrides the traditional UI + * with an iconified version + */ + //% blockId=mp_change_score_override + //% block="change `ICON.pickle` by $thisScore" + //% thisScore.defl=1 + //% color="#b70082" + //% help=github:docs/mp_change_score_override + //% group="Info" + export function changeScoreOverride(thisScore: number) { + info.changeScoreBy(thisScore) + pickle.setScoreOverride(info.score()) + } +} +namespace loops { /** * Run code when the play button is pressed * (Like on start, but jr) @@ -225,13 +346,11 @@ namespace loops{ //% blockId=on_start_simple //% block="on `ICON.play`" //% blockAllowMultiple=0 - export function onStartSimple( a: () => void): void { + export function onStartSimple(a: () => void): void { a(); } } - -namespace music{ - +namespace music { /** * Simplified block to play a song */ @@ -242,22 +361,30 @@ namespace music{ export function simpleSong(thisSong: Playable) { music.play(thisSong, music.PlaybackMode.UntilDone) } - } - //% weight=200 namespace game { + /** + * Start the game timer + */ + //% blockId=game_countdown + //% block="`ICON.clock-white` $thisSec (s)" + //% thisSec.defl = 30 + //% help=github:docs/game_coundown + export function gameCountdown(thisSec: number) { + info.startCountdown(thisSec) + } /** * Run code on an interval of time. This executes before game.onUpdate() * @param body code to execute */ //% help=game/on-update-interval weight=99 afterOnStart=true - //% blockId=gameinterval2 + //% blockId=gameinterval3 //% weight=100 - //% block="every $period seconds" + //% block="every $period second(s)" //% period.defl=1 //% blockAllowMultiple=1 - export function onUpdateInterval2(period: number, a: () => void): void { + export function onUpdateInterval3(period: number, a: () => void): void { period = period * 1000; if (!a || period < 0) return; let timer = 0; @@ -269,47 +396,105 @@ namespace game { } }); } - - - //% blockId=hold_text //% weight=200 //% block="show $thisText" //% thisText.defl="Press (A) to play" - export function holdText(thisText:string) { + export function holdText(thisText: string) { game.showLongText(thisText, DialogLayout.Full) } - - /** * Special lose sequence */ - //% blockId=set_kindling_lose + //% blockId=set_lyla_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 + //% blockId=set_lyla_win //% block="game over `ICON.smile-beam-white`" //% weight=300 //% help=github:docs/set_simple_win export function simpleWin() { game.gameOver(true) } - - + /** + * Special win sequence + */ + //% blockId=set_lyla_g_o + //% block="game over" + //% weight=300 + //% help=github:docs/set_simple_g_o + export function simpleGame() { + if (info.score() >= pickle.pickles_to_get) { + game.simpleWin() + } else { + game.simpleLoss() + } + } + /** + * Show a title and an optional subtitle menu + * Can be dismissed by any player + * @param title + * @param subtitle + */ + //% weight=90 help=game/splashMP + //% blockId=gameSplashMP block="splash %title||%subtitle" + //% title.shadow=text + //% subtitle.shadow=text + //% group="Prompt" + export function splashMP(title: any, subtitle?: any) { + title = console.inspect(title); + subtitle = subtitle ? console.inspect(subtitle) : subtitle; + controller._setUserEventsEnabled(false); + game.pushScene(); + game.currentScene().flags |= scene.Flag.SeeThrough; + const dialog = new SplashDialog(screen.width, subtitle ? 42 : 35); + dialog.setText(title); + if (subtitle) dialog.setSubtext(subtitle); + const s = sprites.create(dialog.image, -1); + let pressed = true; + let done = false; + let connected = false; + mp.onControllerEvent(ControllerEvent.Connected, function (thisPlayer) { + connected = true; + }) + + game.onUpdate(() => { + dialog.update(); + const currentState = ( connected || + (mp.isButtonPressed(mp.playerSelector(mp.PlayerNumber.One), mp.MultiplayerButton.A)) || + (mp.isButtonPressed(mp.playerSelector(mp.PlayerNumber.Two), mp.MultiplayerButton.A)) || + (mp.isButtonPressed(mp.playerSelector(mp.PlayerNumber.Three), mp.MultiplayerButton.A)) || + (mp.isButtonPressed(mp.playerSelector(mp.PlayerNumber.Four), mp.MultiplayerButton.A)) || + (mp.isButtonPressed(mp.playerSelector(mp.PlayerNumber.One), mp.MultiplayerButton.B)) || + (mp.isButtonPressed(mp.playerSelector(mp.PlayerNumber.Two), mp.MultiplayerButton.B)) || + (mp.isButtonPressed(mp.playerSelector(mp.PlayerNumber.Three), mp.MultiplayerButton.B)) || + (mp.isButtonPressed(mp.playerSelector(mp.PlayerNumber.Four), mp.MultiplayerButton.B)) + ) + if (currentState && !pressed) { + connected = false; + pressed = true; + scene.setBackgroundImage(null); // GC it + game.popScene(); + done = true; + } + else if (pressed && !currentState) { + pressed = false; + connected = false; + } + }) + pauseUntil(() => done); + controller._setUserEventsEnabled(true); + } } - -//% weight=300 +//% weight=100 namespace sprites { - export enum Plyrs { //% block="Player 1" One = 0, @@ -320,153 +505,46 @@ namespace sprites { //% block="Player 4" Four = 3 } - - - /** - * Run code on an interval of time. This executes before game.onUpdate() - * @param body code to execute - */ - //% 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 - pickle.setPlayersWith(characters, thing+1) - } - - - /** - * Run code on an interval of time. This executes before game.onUpdate() - * @param body code to execute + * Creates a moving sprite with the image that you choose */ //% blockId=send_flying //% weight=1000 - //% block="add flying $thing" + //% block="add $thing every $interval `ICON.clock-white`" //% thing.shadow=screen_image_picker - export function sendFlying(thing:Image){ - let projectile2 = sprites.createProjectileFromSide(thing, randint(-100, 100), randint(-100, 100)) + //% thing.defl=lyla_imgs.picklechip + //% interval.defl=1 + export function sendFlying(thing: Image, interval:number) { + // Only calls them pickles if they are the default pickle + /*if (thing.equals(lyla_imgs.picklechip)) { + pickle.theseThings = " pickles"; + }*/ + game.onUpdateInterval(interval*1000, function () { + let foodFight = sprites.createProjectileFromSide(thing, randint(-100, 100), randint(-100, 100)) + }) } -} - - -//% color=#b79900 icon="\uf1ce" -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" - //% num.defl=1 - //% list.shadow=variables_get - //% list.defl=characters - export function setPlayersWith(list: Image[], num: number) { - if (num >= pickle.playersConnected) { - pickle.playersConnected = num; - sprites.destroyAllSpritesOfKind(SpriteKind.Player) - let xloc = [ - 40, - 120, - 40, - 120 - ] - let yloc = [ - 30, - 30, - 90, - 90 - ] - for (let index = 0; index <= num - 1; index++) { - mp.setPlayerSprite(mp.getPlayerByIndex(index), sprites.create(list[index], SpriteKind.Player)) - mp.getPlayerSprite(mp.getPlayerByIndex(index)).setStayInScreen(true) - mp.getPlayerSprite(mp.getPlayerByIndex(index)).setPosition(xloc.shift(), yloc.shift()) - mp.getPlayerSprite(mp.getPlayerByIndex(index)).z = 1000 - mp.moveWithButtons(mp.getPlayerByIndex(index)) - } - } - } - - //% blockId=bump_sprite - //% block="$thisSprite bump $thatSprite" - //% thisSprite.shadow=variables_get - //% thisSprite.defl=sprite - //% thatSprite.shadow=variables_get - //% thatSprite.defl=otherSprite - 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()) + * Assign images to players by array + */ + //% blockId=assign_player_images + //% block="team = $img1 $img2 $img3 $img4" + //% img1.shadow=screen_image_picker + //% img2.shadow=screen_image_picker + //% img3.shadow=screen_image_picker + //% img4.shadow=screen_image_picker + //% img1.defl=lyla_imgs.lyla + //% img2.defl=lyla_imgs.stu + //% img3.defl=lyla_imgs.everett + //% img4.defl=lyla_imgs.luke + //% inlineInputMode=inline + //% weight=1200 + export function assignPlayerImgs(img1: Image, img2: Image, img3: Image, img4: Image) { + pickle.characters[0] = img1; + pickle.characters[1] = img2; + pickle.characters[2] = img3; + pickle.characters[3] = img4; } - - } - //% weight=250 namespace info { /** @@ -474,18 +552,16 @@ namespace info { * @param score The score to check for, eg: 100 * @param handler The code to run when the score is reached */ - //% blockId=mp_onScore2 + //% blockId=onScore2 //% block="after $score `ICON.pickle`" //% score.defl=20 //% blockGap=8 - //% help=multiplayer/on-score - //% parts="multiplayer" + //% help=docs/on-score + //% group="Info" export function onScore2(score: number, handler: () => void) { - mp._mpstate().onReachedScore(score, handler); + info.onScore(score, handler); } - } - //% weight=100 namespace scene { /** @@ -495,27 +571,27 @@ namespace scene { //% block="set scene $thisBG" //% thisBG.shadow=lyla_bg_image_picker //% help=docs/set_bg + //% group="Scene" 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 - } + //% 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 @@ -529,7 +605,7 @@ namespace images { "#FDFF70", "#8E2EC4", "#408325", - "#135847", + "#4166D8", "#10CCE5", "#95D6B1", "#A4839F", @@ -554,3 +630,4 @@ namespace images { "tilemap.g.ts": "// Auto-generated code. Do not edit.\nnamespace myTiles {\n //% fixedInstance jres blockIdentity=images._tile\n export const transparency16 = image.ofBuffer(hex``);\n\n helpers._registerFactory(\"tile\", function(name: string) {\n switch(helpers.stringTrim(name)) {\n case \"transparency16\":return transparency16;\n }\n return null;\n })\n\n}\n// Auto-generated code. Do not edit.\n" } ``` + diff --git a/docs/tutorials/lyla-jr.md b/docs/tutorials/lyla-jr.md index c630bf3ea52..eb3e7a6634d 100644 --- a/docs/tutorials/lyla-jr.md +++ b/docs/tutorials/lyla-jr.md @@ -1,9 +1,10 @@ -# Lyla and Ev's Snack Chase +# Lyla and Stu's Snack Chase ### @explicitHints true ### @flyoutOnly true +### @hideDone true -## Lyla and Ev's Snack Chase @showdialog +## Lyla and Stu's Snack Chase @showdialog **Let's code a video game with Lyla, Everett, Luke and Stu!** @@ -40,10 +41,14 @@ sprites.sendFlying(lyla_imgs.picklechip, 1) ## {Step 3} -**Add a background!** +**Set the scene!** + +--- ![Use the set scene block](/static/tutorials/lyla/bg.gif "Use the set scene block" ) +--- + The background in the block is Loops Lunch! Click on the image to draw your own background. @@ -63,7 +68,7 @@ scene.setBG(lyla_imgs.diner) **Try your game!** -[Re-Link Intro Video Here] +--- Press A (or the space bar) to clear the message, then use the arrow keys to catch the snacks. @@ -75,12 +80,15 @@ catch the snacks. **Add a timer!** +--- ![Grab the timer block](/static/tutorials/lyla/timer.gif "The timer will count down from 45 to 0." ) +--- + How many snacks can you catch before time runs out? -If its too hard, add more seconds to the timer. If it's too easy, try taking time away. +If the game is too hard, add more seconds to the timer. If it's too easy, try taking time away. @@ -96,69 +104,83 @@ game.gameCountdown(30) +## {Step 7} -## {Step 6} +🥒 You did it! 🥒 -**Make more changes!** -![Add something special](/static/tutorials/lyla/more.gif "Add something special") +You made a video game! -If you want, you can change the players, change the snacks, and add sounds! +![You finished your game!](/static/tutorials/lyla/finish.gif "You finished your game") -#### ~ tutorialhint -```blocks -sprites.sendFlying(lyla_imgs.picklechip, 1) -scene.setBG(lyla_imgs.diner) -game.gameCountdown(30) -//@highlight -sprites.assignPlayerImgs(lyla_imgs.lyla, lyla_imgs.louisa, lyla_imgs.liana, lyla_imgs.luke) -music.play(music.createSong(assets.song`countdown`), music.PlaybackMode.InBackground) -``` + +## Play with Friends @showdialog + + +You can play your game with one other friend using the same keyboard. + +![Picture of keys to use to play game](/static/tutorials/lyla/key.png "Key for keyboard keys") + +--- + +~hint Click here to learn how to play online with more friends. + +--- + +![balloon intro](youtube:jZGvmt6X880) + +hint~ ## {Finale} -**🥒 You did it! 🥒** +**Want to keep working?** -![You finished your game!](/static/tutorials/lyla/finish.gif "You finished your game") +--- +Add more blocks to change players, change snacks, or add music! -You made a video game! +![Add something special](/static/tutorials/lyla/more.gif "Add something special") -You can play with one other friend on the same keyboard, -or start a game with more friends by clicking **Done** and -clicking "Host Multiplayer Game". +--- -```blockconfig.global +#### ~ tutorialhint.... + +```blocks +sprites.sendFlying(lyla_imgs.picklechip, 1) scene.setBG(lyla_imgs.diner) game.gameCountdown(30) -sprites.sendFlying(lyla_imgs.picklechip, 1) sprites.assignPlayerImgs(lyla_imgs.lyla, lyla_imgs.stu, lyla_imgs.everett, lyla_imgs.luke) -music.play(music.melodyPlayable(music.baDing), music.PlaybackMode.InBackground) - +music.play(music.createSong(assets.song`countdown`), music.PlaybackMode.InBackground) ``` -```ghost + +```blockconfig.global scene.setBG(lyla_imgs.diner) game.gameCountdown(30) sprites.sendFlying(lyla_imgs.picklechip, 1) -sprites.assignPlayerImgs(lyla_imgs.lyla, lyla_imgs.stu, lyla_imgs.everett, lyla_imgs.luke) -music.play(music.melodyPlayable(music.baDing), music.PlaybackMode.UntilDone) music.play(music.createSong(assets.song`countdown`), music.PlaybackMode.InBackground) ``` +```ghost +scene.setBG(lyla_imgs.diner) +game.gameCountdown(30) +sprites.sendFlying(lyla_imgs.picklechip, 1) +``` + + ```package multiplayer