pxt-arcade 1.7.3 → 1.7.7
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 -0
- package/built/common-sim.js +4 -0
- package/built/target.js +1788 -236
- package/built/target.json +1788 -236
- package/built/targetlight.json +5 -5
- package/built/theme.json +3 -2
- package/docs/gamejam/global-2021.html +459 -0
- package/docs/hour-of-code/all.md +27 -0
- package/docs/hour-of-code/{educators.html → educators-2020.html} +25 -25
- package/docs/hour-of-code/educators-2021.html +625 -0
- package/docs/{hour-of-code.html → hour-of-code-2020.html} +37 -37
- package/docs/hour-of-code-2021.html +438 -183
- package/docs/hour-of-code-ref.json +3 -0
- package/docs/index-ref.json +1 -1
- package/docs/multipart-tutorials.md +0 -8
- package/docs/projects/SUMMARY.md +3 -2
- package/docs/recipes.md +0 -7
- package/docs/skillmap/clicker/clicker1.md +7 -7
- package/docs/skillmap/clicker/clicker2.md +9 -9
- package/docs/skillmap/clicker/clicker3.md +8 -8
- package/docs/skillmap/clicker/clicker4.md +8 -8
- package/docs/skillmap/clicker/clicker4a.md +7 -7
- package/docs/skillmap/clicker/clicker5.md +3 -3
- package/docs/skillmap/clicker-themed/clickert1.md +66 -38
- package/docs/skillmap/clicker-themed/clickert2.md +77 -58
- package/docs/skillmap/clicker-themed/clickert3.md +75 -55
- package/docs/skillmap/clicker-themed/clickert4.md +105 -118
- package/docs/skillmap/collector/collector1.md +11 -11
- package/docs/skillmap/collector/collector1a.md +8 -8
- package/docs/skillmap/collector/collector2.md +8 -8
- package/docs/skillmap/collector/collector3.md +8 -8
- package/docs/skillmap/collector/collector3a.md +7 -7
- package/docs/skillmap/collector/collector4.md +8 -8
- package/docs/skillmap/collector/collector5.md +2 -2
- package/docs/skillmap/collector-themed/collectort1.md +107 -88
- package/docs/skillmap/collector-themed/collectort2.md +109 -87
- package/docs/skillmap/collector-themed/collectort3.md +138 -115
- package/docs/skillmap/collector-themed/collectort4.md +130 -118
- package/docs/skillmap/collector-themed/collectort4old.md +23 -23
- package/docs/skillmap/collector-themed/collectort5.md +2 -2
- package/docs/skillmap/educator-info/forest-map-info.md +34 -25
- package/docs/skillmap/educator-info/pongo-map-info.md +55 -0
- package/docs/skillmap/educator-info/racer-map-info.md +105 -0
- package/docs/skillmap/educator-info/rockstar-map-info.md +1 -1
- package/docs/skillmap/educator-info/simple-shark-map-info.md +101 -0
- package/docs/skillmap/forest/forest1.md +1 -69
- package/docs/skillmap/forest/forest2.md +5 -65
- package/docs/skillmap/forest/forest3.md +1 -174
- package/docs/skillmap/forest/forest4.md +2 -336
- package/docs/skillmap/forest/forest5.md +1 -396
- package/docs/skillmap/forest/forest6.md +6 -372
- package/docs/skillmap/forest-old.md +92 -0
- package/docs/skillmap/forest.md +9 -9
- package/docs/skillmap/forest_new/forest1.md +191 -0
- package/docs/skillmap/forest_new/forest2.md +217 -0
- package/docs/skillmap/forest_new/forest3.md +333 -0
- package/docs/skillmap/forest_new/forest4.md +196 -0
- package/docs/skillmap/forest_new/forest5.md +291 -0
- package/docs/skillmap/forest_new/forest6.md +272 -0
- package/docs/skillmap/interface/activity1.md +41 -49
- package/docs/skillmap/jungle/jungle1.md +48 -28
- package/docs/skillmap/jungle/jungle2.md +50 -26
- package/docs/skillmap/jungle/jungle3.md +48 -27
- package/docs/skillmap/jungle/jungle4.md +76 -58
- package/docs/skillmap/jungle/jungle5.md +31 -25
- package/docs/skillmap/jungle/jungle6.md +34 -28
- package/docs/skillmap/jungle/jungle7.md +36 -24
- package/docs/skillmap/jungle/jungle8.md +27 -25
- package/docs/skillmap/jungle.md +7 -3
- package/docs/skillmap/long-shark.md +119 -0
- package/docs/skillmap/pongo/pongo1.md +256 -0
- package/docs/skillmap/pongo/pongo2.md +179 -0
- package/docs/skillmap/pongo/pongo3.md +177 -0
- package/docs/skillmap/pongo.md +59 -0
- package/docs/skillmap/racer.md +7 -7
- package/docs/skillmap/rockstar/rockstar1.md +32 -41
- package/docs/skillmap/rockstar/rockstar2.md +45 -27
- package/docs/skillmap/rockstar/rockstar3.md +45 -27
- package/docs/skillmap/rockstar.md +3 -1
- package/docs/skillmap/shark/shark1-simple.md +151 -0
- package/docs/skillmap/shark/shark2-simple.md +203 -0
- package/docs/skillmap/shark/shark3-simple.md +204 -0
- package/docs/skillmap/shark/shark4-simple.md +246 -0
- package/docs/skillmap/shark/shark4a-simple.md +244 -0
- package/docs/skillmap/shark.md +25 -58
- package/docs/skillmap/space/space1.md +63 -29
- package/docs/skillmap/space/space2.md +34 -25
- package/docs/skillmap/space/space3.md +86 -69
- package/docs/skillmap/space/space4.md +96 -65
- package/docs/skillmap/space/space4a.md +34 -25
- package/docs/skillmap/space/space5.md +81 -45
- package/docs/skillmap/space/space6.md +59 -81
- package/docs/skillmap/space.md +8 -5
- package/docs/skillmap/story/card.md +6 -6
- package/docs/skillmap/story/card2.md +6 -6
- package/docs/skillmap/story/story1.md +60 -175
- package/docs/skillmap/story/story2.md +89 -327
- package/docs/skillmap/story/story3.md +238 -228
- package/docs/skillmap/story/story4.md +23 -23
- package/docs/skillmap/zoo/zoo1.md +31 -16
- package/docs/skillmap/zoo/zoo2.md +45 -30
- package/docs/skillmap/zoo/zoo2a.md +51 -36
- package/docs/skillmap/zoo/zoo3.md +8 -7
- package/docs/skillmap/zoo/zoo4.md +61 -32
- package/docs/skillmap/zoo/zoo5.md +41 -31
- package/docs/skillmap/zoo.md +2 -2
- package/docs/skillmaps.md +20 -4
- package/docs/static/experiments/accessibleblocks.png +0 -0
- package/docs/static/experiments/blockserrorlist.png +0 -0
- package/docs/static/gamejam/jams/global-2021/assets/banner.png +0 -0
- package/docs/static/gamejam/jams/global-2021/info.json +10 -0
- package/docs/static/gamejam/jams/global-2021/rules.md +22 -0
- package/docs/static/gamejam/jams/global-2021/style.css +141 -0
- package/docs/static/gamejam/lib/gamejam.d.ts +1 -0
- package/docs/static/gamejam/lib/gamejam.js +34 -24
- package/docs/static/gamejam/lib/gamejam.ts +35 -24
- package/docs/static/hero-gallery/stream.png +0 -0
- package/docs/static/hour-of-code/{apple.png → 2020/apple.png} +0 -0
- package/docs/static/hour-of-code/{arcade.png → 2020/arcade.png} +0 -0
- package/docs/static/hour-of-code/{asphodel.png → 2020/asphodel.png} +0 -0
- package/docs/static/hour-of-code/{card.png → 2020/card.png} +0 -0
- package/docs/static/hour-of-code/{chase-the-pizza.png → 2020/chase-the-pizza.png} +0 -0
- package/docs/static/hour-of-code/{clovers.png → 2020/clovers.png} +0 -0
- package/docs/static/hour-of-code/{design.png → 2020/design.png} +0 -0
- package/docs/static/hour-of-code/{educators → 2020/educators}/asphodel-level1.png +0 -0
- package/docs/static/hour-of-code/{educators → 2020/educators}/asphodel-level4.png +0 -0
- package/docs/static/hour-of-code/{educators → 2020/educators}/asphodel-level6.png +0 -0
- package/docs/static/hour-of-code/{educators → 2020/educators}/asphodel-level7.png +0 -0
- package/docs/static/hour-of-code/{educators → 2020/educators}/asphodel-level9.png +0 -0
- package/docs/static/hour-of-code/{educators → 2020/educators}/clover-design.gif +0 -0
- package/docs/static/hour-of-code/{educators → 2020/educators}/shark-attack-tutorial.png +0 -0
- package/docs/static/hour-of-code/{galga.png → 2020/galga.png} +0 -0
- package/docs/static/hour-of-code/{lemon-leak.png → 2020/lemon-leak.png} +0 -0
- package/docs/static/hour-of-code/{micro-bit.png → 2020/micro-bit.png} +0 -0
- package/docs/static/hour-of-code/{minecraft.png → 2020/minecraft.png} +0 -0
- package/docs/static/hour-of-code/{nfl.png → 2020/nfl.png} +0 -0
- package/docs/static/hour-of-code/{ocean-jam.png → 2020/ocean-jam.png} +0 -0
- package/docs/static/hour-of-code/{pixel-background-primary.png → 2020/pixel-background-primary.png} +0 -0
- package/docs/static/hour-of-code/{pixel-background-secondary.png → 2020/pixel-background-secondary.png} +0 -0
- package/docs/static/hour-of-code/{shadowed-aside-frame.png → 2020/shadowed-aside-frame.png} +0 -0
- package/docs/static/hour-of-code/{shadowed-button-frame.png → 2020/shadowed-button-frame.png} +0 -0
- package/docs/static/hour-of-code/{shadowed-primary-frame.png → 2020/shadowed-primary-frame.png} +0 -0
- package/docs/static/hour-of-code/{shark-attack.png → 2020/shark-attack.png} +0 -0
- package/docs/static/hour-of-code/{simulator.gif → 2020/simulator.gif} +0 -0
- package/docs/static/hour-of-code/{simulator.png → 2020/simulator.png} +0 -0
- package/docs/static/hour-of-code/{styles.css → 2020/styles.css} +1 -1
- package/docs/static/hour-of-code/2021/Rowdies/OFL.txt +93 -0
- package/docs/static/hour-of-code/2021/Rowdies/Rowdies-Bold.ttf +0 -0
- package/docs/static/hour-of-code/2021/Rowdies/Rowdies-Regular.ttf +0 -0
- package/docs/static/hour-of-code/2021/beginner-skillmap.png +0 -0
- package/docs/static/hour-of-code/2021/favicon.png +0 -0
- package/docs/static/hour-of-code/2021/forest-skillmap-game.gif +0 -0
- package/docs/static/hour-of-code/2021/game-jam-hero.png +0 -0
- package/docs/static/hour-of-code/2021/hoc-2020.png +0 -0
- package/docs/static/hour-of-code/2021/hoc-card.png +0 -0
- package/docs/static/hour-of-code/2021/hoc-header-educators.png +0 -0
- package/docs/static/hour-of-code/2021/hoc-header-plane.gif +0 -0
- package/docs/static/hour-of-code/2021/hoc-header-scene.gif +0 -0
- package/docs/static/hour-of-code/2021/jungle-skillmap.png +0 -0
- package/docs/static/hour-of-code/2021/makecode-example.png +0 -0
- package/docs/static/hour-of-code/2021/microbit.png +0 -0
- package/docs/static/hour-of-code/2021/minecraft.png +0 -0
- package/docs/static/hour-of-code/2021/rockstar-skillmap.png +0 -0
- package/docs/static/hour-of-code/2021/styles.css +660 -62
- package/docs/static/logo.png +0 -0
- package/docs/static/skillmap/assets/my-assets-three.png +0 -0
- package/docs/static/skillmap/assets/sprite-from-container.gif +0 -0
- package/docs/static/skillmap/backgrounds/jungle-bg.png +0 -0
- package/docs/static/skillmap/backgrounds/jungle-map.png +0 -0
- package/docs/static/skillmap/backgrounds/rock-map.png +0 -0
- package/docs/static/skillmap/backgrounds/rockstar-card.gif +0 -0
- package/docs/static/skillmap/backgrounds/space-comp.png +0 -0
- package/docs/static/skillmap/backgrounds/space.png +0 -0
- package/docs/static/skillmap/certificates/forest-cert.pdf +0 -0
- package/docs/static/skillmap/certificates/forest-cert.png +0 -0
- package/docs/static/skillmap/certificates/jungle-cert.pdf +0 -0
- package/docs/static/skillmap/certificates/jungle-cert.png +0 -0
- package/docs/static/skillmap/certificates/rockstar-cert.pdf +0 -0
- package/docs/static/skillmap/certificates/rockstar-cert.png +0 -0
- package/docs/static/skillmap/certificates/shark-cert.pdf +0 -0
- package/docs/static/skillmap/certificates/shark-cert.png +0 -0
- package/docs/static/skillmap/certificates/space-cert.pdf +0 -0
- package/docs/static/skillmap/certificates/space-cert.png +0 -0
- package/docs/static/skillmap/pongo/pongo1.gif +0 -0
- package/docs/static/skillmap/pongo/pongo2gif +0 -0
- package/docs/static/skillmap/pongo/pongo3.gif +0 -0
- package/docs/static/skillmap/racer/racer1.gif +0 -0
- package/docs/static/skillmap/racer/racer2.gif +0 -0
- package/docs/static/skillmap/racer/racer3.gif +0 -0
- package/docs/static/skillmap/rockstar/rockstar1.gif +0 -0
- package/docs/static/skillmap/rockstar/rockstar2.gif +0 -0
- package/docs/static/skillmap/rockstar/rockstar3.gif +0 -0
- package/docs/static/skillmap/shark/shark1-simple.gif +0 -0
- package/docs/static/skillmap/shark/shark4a-simple.gif +0 -0
- package/docs/static/skillmap/zoo/overlaps-food-sprite.gif +0 -0
- package/docs/tutorials/barrel-dodger.md +4 -4
- package/docs/tutorials/collect-the-clovers.md +2 -2
- package/docs/tutorials/froggy.md +105 -90
- package/docs/tutorials/hundred.md +400 -0
- package/package.json +3 -3
- package/pxtarget.json +3 -2
- package/targetconfig.json +4 -1
- package/docs/recipes/wonder-woman-1984/01-maze.md +0 -291
- package/docs/recipes/wonder-woman-1984/02-artifact.md +0 -70
- package/docs/recipes/wonder-woman-1984/03-enemies.md +0 -65
- package/docs/skillmap/forest/forest9.md +0 -714
- package/docs/static/hour-of-code/2021/placeholder.png +0 -0
- package/docs/static/hour-of-code/ww-maze.png +0 -0
- package/docs/static/recipes/wonder-woman-1984/artifact-preview.png +0 -0
- package/docs/static/recipes/wonder-woman-1984/artifacts-location.gif +0 -0
- package/docs/static/recipes/wonder-woman-1984/draw-maze-backup.png +0 -0
- package/docs/static/recipes/wonder-woman-1984/draw-walls-backup.png +0 -0
- package/docs/static/recipes/wonder-woman-1984/end-position.png +0 -0
- package/docs/static/recipes/wonder-woman-1984/enemies-location.gif +0 -0
- package/docs/static/recipes/wonder-woman-1984/enemies-preview.png +0 -0
- package/docs/static/recipes/wonder-woman-1984/fill-maze.gif +0 -0
- package/docs/static/recipes/wonder-woman-1984/fill-walls.gif +0 -0
- package/docs/static/recipes/wonder-woman-1984/wonder-woman3.png +0 -0
- package/docs/static/recipes/wonder-woman-1984/ww-splash3.gif +0 -0
- package/docs/static/recipes/wonder-woman-1984/ww-splash3.mp4 +0 -0
- package/docs/static/ww84-background.png +0 -0
- package/docs/static/ww84-header.png +0 -0
- package/docs/ww84.html +0 -276
- package/sim/public/locales/zh-CN/bundled-strings.json +0 -1800
- package/sim/public/locales/zh-CN/target-strings.json +0 -13
- package/sim/public/locales/zh-TW/bundled-strings.json +0 -1903
- package/sim/public/locales/zh-TW/target-strings.json +0 -8
|
@@ -1,106 +1,7 @@
|
|
|
1
1
|
# Simple Clicker Store
|
|
2
2
|
|
|
3
|
-
### @autoexpandOff true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
{
|
|
7
|
-
"README.md": " ",
|
|
8
|
-
"images.g.jres": "{\n \"image2\": {\n \"data\": \"hwQeABAAAAAAAAAAuwsAAAAAALsbuwAAAACwGxGxAAAAALsREbELAAAAGxEREQsAAAAbERERCwAAsBsREdELAAC73RER0bsAsBHRERHRvQu7ERERERERCxsRERERERG7GxEREREREbEbERERERERsbsRERERERGxsBEREREREbEAuxERERERsQCwGxHRERG7AAAbER0dsQsAABvREdGxAAAAGxEREbsAAAAbERERCwAAsBsRERG7AACwEREREbEAALAbERERsQAAALu7ERG7AAAAALAbEQsAAAAAALsRCwAAAAAAsLsLAAAAAAAAuwAAAAAAAAAAAAA=\",\n \"mimeType\": \"image/x-mkcd-f4\",\n \"displayName\": \"Cloud\"\n },\n \"image3\": \"hwQeABAAAAAAAAAAuwsAAAAAALsbuwAAAACwGxGxAAAAALsREbELAAAAGxEREQsAAAAbERERCwAAsBsREdELAAC73RER0bsAsBHRERHRvQu7ERERERERCxsRERERERG7GxEREREREbEbERERERERsbsRERERERGxsBEREREREbEAuxERERERsQCwGxHRERG7AAAbER0dsQsAABvREdGxAAAAGxEREbsAAAAbERERCwAAsBsRERG7AACwEREREbEAALAbERERsQAAALu7ERG7AAAAALAbEQsAAAAAALsRCwAAAAAAsLsLAAAAAAAAuwAAAAAAAAAAAAA=\",\n \"*\": {\n \"mimeType\": \"image/x-mkcd-f4\",\n \"dataEncoding\": \"base64\",\n \"namespace\": \"myImages\"\n }\n}",
|
|
9
|
-
"images.g.ts": "// Auto-generated code. Do not edit.\nnamespace myImages {\n\n helpers._registerFactory(\"image\", function(name: string) {\n switch(helpers.stringTrim(name)) {\n case \"image2\":\n case \"Cloud\":return img`\n.........bbbbb................\n........bb111bb...............\n.......b1111111b..............\n......bb1111111bb....bbb......\n...bbbbd11111111bbbbbb1bb.....\n..bb111dd111111111111111b.....\n.bb111111111111111111111b.....\n.b1111111111111111d11111bb....\nbb111111111111111d1111111bb...\nb111111111111111d111111111bb..\nbb111111111111111d111111111bb.\n.bbb11ddd111111111d11111111bb.\n...bbbbbd1111111111bbb11bbbb..\n.......bb11111111bbb.bbbb.....\n........bbb11111bb............\n..........bbbbbbb.............\n`;\n case \"image3\":return img`\n.........bbbbb................\n........bb111bb...............\n.......b1111111b..............\n......bb1111111bb....bbb......\n...bbbbd11111111bbbbbb1bb.....\n..bb111dd111111111111111b.....\n.bb111111111111111111111b.....\n.b1111111111111111d11111bb....\nbb111111111111111d1111111bb...\nb111111111111111d111111111bb..\nbb111111111111111d111111111bb.\n.bbb11ddd111111111d11111111bb.\n...bbbbbd1111111111bbb11bbbb..\n.......bb11111111bbb.bbbb.....\n........bbb11111bb............\n..........bbbbbbb.............\n`;\n }\n return null;\n })\n\n helpers._registerFactory(\"animation\", function(name: string) {\n switch(helpers.stringTrim(name)) {\n\n }\n return null;\n })\n\n}\n// Auto-generated code. Do not edit.\n",
|
|
10
|
-
"main.blocks": "<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable type=\"KIND_SpriteKind\" id=\"4B?GV*)eD5DUvikVNk$t\">Player</variable><variable type=\"KIND_SpriteKind\" id=\"6j5)LMVdgl^XeJC*L.Dw\">Projectile</variable><variable type=\"KIND_SpriteKind\" id=\"TJcarl[PVtMHvEjiAkQ=\">Food</variable><variable type=\"KIND_SpriteKind\" id=\"l9d!xsEb8*84@?y9RWQJ\">Enemy</variable><variable id=\"OhzSzwl78,9[a~*FxDB+\">mySprite</variable><variable id=\"I?4@gJV,8)yi2RplwDBf\">power</variable><variable id=\"?SrrdKP|Z)`PL`-|XKVQ\">mySprite2</variable></variables><block type=\"pxt-on-start\" x=\"0\" y=\"0\"><statement name=\"HANDLER\"><block type=\"gamesetbackgroundcolor\"><value name=\"color\"><shadow type=\"colorindexpicker\"><field name=\"index\">11</field></shadow></value><next><block type=\"variables_set\"><field name=\"VAR\" id=\"I?4@gJV,8)yi2RplwDBf\">power</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">1</field></shadow></value><next><block type=\"gamecountdown\"><value name=\"duration\"><shadow type=\"math_number\"><field name=\"NUM\">10</field></shadow></value><next><block type=\"gameSplash\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" _expanded=\"0\" _input_init=\"true\"></mutation><value name=\"title\"><shadow type=\"text\"><field name=\"TEXT\">Press (A) to earn clicks!</field></shadow></value><value name=\"subtitle\"><shadow type=\"text\"><field name=\"TEXT\"/></shadow></value></block></next></block></next></block></next></block></statement></block><block type=\"keyonevent\" x=\"410\" y=\"10\"><field name=\"button\">controller.B</field><field name=\"event\">ControllerButtonEvent.Pressed</field><statement name=\"HANDLER\"><block type=\"hudChangeScoreBy\"><value name=\"value\"><shadow type=\"math_number\"><field name=\"NUM\">-20</field></shadow></value><next><block type=\"variables_change\"><field name=\"VAR\" id=\"I?4@gJV,8)yi2RplwDBf\">power</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">1</field></shadow></value><next><block type=\"game_show_long_text\"><field name=\"layout\">DialogLayout.Top</field><value name=\"str\"><shadow type=\"text\"><field name=\"TEXT\">You bought one extra click!</field></shadow></value></block></next></block></next></block></statement></block><block type=\"gamecountdownevent\" x=\"290\" y=\"270\"><statement name=\"HANDLER\"><block type=\"gameOver\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" _expanded=\"1\" _input_init=\"true\"></mutation><field name=\"effect\">effects.confetti</field><value name=\"win\"><shadow type=\"toggleWinLose\"><field name=\"win\">true</field></shadow></value></block></statement></block><block type=\"keyonevent\" x=\"30\" y=\"410\"><field name=\"button\">controller.A</field><field name=\"event\">ControllerButtonEvent.Pressed</field><statement name=\"HANDLER\"><block type=\"variables_set\"><field name=\"VAR\" id=\"OhzSzwl78,9[a~*FxDB+\">mySprite</field><value name=\"VALUE\"><shadow xmlns=\"http://www.w3.org/1999/xhtml\" type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"spritescreate\"><value name=\"img\"><shadow type=\"screen_image_picker\"><field name=\"img\">img`\n.........bbbbb................\n........bb111bb...............\n.......b1111111b..............\n......bb1111111bb....bbb......\n...bbbbd11111111bbbbbb1bb.....\n..bb111dd111111111111111b.....\n.bb111111111111111111111b.....\n.b1111111111111111d11111bb....\nbb111111111111111d1111111bb...\nb111111111111111d111111111bb..\nbb111111111111111d111111111bb.\n.bbb11ddd111111111d11111111bb.\n...bbbbbd1111111111bbb11bbbb..\n.......bb11111111bbb.bbbb.....\n........bbb11111bb............\n..........bbbbbbb.............\n`</field><data>{\"commentRefs\":[],\"fieldData\":{\"img\":\"myImages.image3\"}}</data></shadow></value><value name=\"kind\"><shadow type=\"spritekind\"><field name=\"MEMBER\">Player</field></shadow></value></block></value><next><block type=\"startEffectOnSprite\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" _expanded=\"0\" _input_init=\"false\"></mutation><field name=\"effect\">effects.spray</field><value name=\"sprite\"><block type=\"variables_get\"><field name=\"VAR\" id=\"OhzSzwl78,9[a~*FxDB+\">mySprite</field></block></value><next><block type=\"hudChangeScoreBy\"><value name=\"value\"><shadow type=\"math_number\"><field name=\"NUM\">1</field></shadow><block type=\"variables_get\"><field name=\"VAR\" id=\"I?4@gJV,8)yi2RplwDBf\">power</field></block></value></block></next></block></next></block></statement></block></xml>",
|
|
11
|
-
"main.ts": "controller.B.onEvent(ControllerButtonEvent.Pressed, function () {\n info.changeScoreBy(-20)\n power2 += 1\n game.showLongText(\"You bought one extra click!\", DialogLayout.Top)\n})\ncontroller.A.onEvent(ControllerButtonEvent.Pressed, function () {\n mySprite = sprites.create(img`\n .........bbbbb................\n ........bb111bb...............\n .......b1111111b..............\n ......bb1111111bb....bbb......\n ...bbbbd11111111bbbbbb1bb.....\n ..bb111dd111111111111111b.....\n .bb111111111111111111111b.....\n .b1111111111111111d11111bb....\n bb111111111111111d1111111bb...\n b111111111111111d111111111bb..\n bb111111111111111d111111111bb.\n .bbb11ddd111111111d11111111bb.\n ...bbbbbd1111111111bbb11bbbb..\n .......bb11111111bbb.bbbb.....\n ........bbb11111bb............\n ..........bbbbbbb.............\n `, SpriteKind.Player)\n mySprite.startEffect(effects.spray)\n info.changeScoreBy(power2)\n})\ninfo.onCountdownEnd(function () {\n game.over(true, effects.confetti)\n})\nlet mySprite: Sprite = null\nlet power2 = 0\nscene.setBackgroundColor(11)\npower2 = 1\ninfo.startCountdown(10)\ngame.splash(\"Press (A) to earn clicks!\")\n",
|
|
12
|
-
"pxt.json": "{\n \"name\": \"clicker-withTimer\",\n \"description\": \"\",\n \"dependencies\": {\n \"device\": \"*\"\n },\n \"files\": [\n \"main.blocks\",\n \"main.ts\",\n \"README.md\",\n \"tilemap.g.jres\",\n \"tilemap.g.ts\",\n \"images.g.jres\",\n \"images.g.ts\"\n ],\n \"targetVersions\": {\n \"branch\": \"v1.2.16\",\n \"tag\": \"v1.2.16\",\n \"commits\": \"https://github.com/microsoft/pxt-arcade/commits/971a86b03314f200ceb1a951ad277d1d6b8c1e23\",\n \"target\": \"1.2.16\",\n \"pxt\": \"6.2.30\"\n },\n \"preferredEditor\": \"blocksprj\"\n}\n",
|
|
13
|
-
"tilemap.g.jres": "{\n \"transparency16\": {\n \"data\": \"hwQQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\",\n \"mimeType\": \"image/x-mkcd-f4\",\n \"tilemapTile\": true\n },\n \"*\": {\n \"mimeType\": \"image/x-mkcd-f4\",\n \"dataEncoding\": \"base64\",\n \"namespace\": \"myTiles\"\n }\n}",
|
|
14
|
-
"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"
|
|
15
|
-
}
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
```template
|
|
19
|
-
controller.B.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
20
|
-
power += 1
|
|
21
|
-
game.showLongText("You bought one extra click!", DialogLayout.Center)
|
|
22
|
-
})
|
|
23
|
-
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
24
|
-
info.changeScoreBy(power)
|
|
25
|
-
mySprite.startEffect(effects.spray, 100)
|
|
26
|
-
})
|
|
27
|
-
info.onCountdownEnd(function () {
|
|
28
|
-
game.over(true, effects.confetti)
|
|
29
|
-
})
|
|
30
|
-
let power = 0
|
|
31
|
-
let mySprite: Sprite = null
|
|
32
|
-
scene.setBackgroundColor(11)
|
|
33
|
-
info.startCountdown(10)
|
|
34
|
-
game.splash("Press (A) to earn clicks!")
|
|
35
|
-
mySprite = sprites.create(img`
|
|
36
|
-
.........bbbbb................
|
|
37
|
-
........bb111bb...............
|
|
38
|
-
.......b1111111b..............
|
|
39
|
-
......bb1111111bb....bbb......
|
|
40
|
-
...bbbbd11111111bbbbbb1bb.....
|
|
41
|
-
..bb111dd111111111111111b.....
|
|
42
|
-
.bb111111111111111111111b.....
|
|
43
|
-
.b1111111111111111d11111bb....
|
|
44
|
-
bb111111111111111d1111111bb...
|
|
45
|
-
b111111111111111d111111111bb..
|
|
46
|
-
bb111111111111111d111111111bb.
|
|
47
|
-
.bbb11ddd111111111d11111111bb.
|
|
48
|
-
...bbbbbd1111111111bbb11bbbb..
|
|
49
|
-
.......bb11111111bbb.bbbb.....
|
|
50
|
-
........bbb11111bb............
|
|
51
|
-
..........bbbbbbb.............
|
|
52
|
-
`, SpriteKind.Player)
|
|
53
|
-
power = 1
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
```ghost
|
|
58
|
-
|
|
59
|
-
controller.B.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
60
|
-
if (10 <= info.score()) {
|
|
61
|
-
let mySprite: Sprite = null
|
|
62
|
-
info.changeScoreBy(-10)
|
|
63
|
-
power +=1
|
|
64
|
-
mySprite.say("You've purchased a super-clicker")
|
|
65
|
-
game.showLongText("You bought an auto-clicker!", DialogLayout.Center)
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
})
|
|
69
|
-
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
70
|
-
info.changeScoreBy(clicks)
|
|
71
|
-
})
|
|
72
|
-
let autoClicks = 0
|
|
73
|
-
let clicks = 0
|
|
74
|
-
clicks = 1
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
game.splash("")
|
|
78
|
-
game.setDialogTextColor(0)
|
|
79
|
-
game.setDialogCursor(img`
|
|
80
|
-
. . . . . . . . . . . . . . . .
|
|
81
|
-
. . . . . . . . . . . . . . . .
|
|
82
|
-
. . . . . . . . . . . . . . . .
|
|
83
|
-
. . . . . . . . . . . . . . . .
|
|
84
|
-
. . . . . . . . . . . . . . . .
|
|
85
|
-
. . . . . . . . . . . . . . . .
|
|
86
|
-
. . . . . . . . . . . . . . . .
|
|
87
|
-
. . . . . . . . . . . . . . . .
|
|
88
|
-
. . . . . . . . . . . . . . . .
|
|
89
|
-
. . . . . . . . . . . . . . . .
|
|
90
|
-
. . . . . . . . . . . . . . . .
|
|
91
|
-
. . . . . . . . . . . . . . . .
|
|
92
|
-
. . . . . . . . . . . . . . . .
|
|
93
|
-
. . . . . . . . . . . . . . . .
|
|
94
|
-
. . . . . . . . . . . . . . . .
|
|
95
|
-
. . . . . . . . . . . . . . . .
|
|
96
|
-
`)
|
|
97
|
-
})
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
## Introduction @showdialog
|
|
4
|
+
## {Introduction @showdialog}
|
|
104
5
|
|
|
105
6
|
What's more fun than pressing buttons?
|
|
106
7
|
|
|
@@ -112,7 +13,7 @@ Let's modify our clicker game to offer a simple shop.
|
|
|
112
13
|
|
|
113
14
|

|
|
114
15
|
|
|
115
|
-
## Step 1
|
|
16
|
+
## {Step 1}
|
|
116
17
|
|
|
117
18
|
**The code for a clicker game is already in the workspace.**
|
|
118
19
|
|
|
@@ -121,10 +22,10 @@ what fun is it to get extra power for free? Let's add code to charge the player
|
|
|
121
22
|
|
|
122
23
|
---
|
|
123
24
|
|
|
124
|
-
|
|
25
|
+
- :mouse pointer: From the ``||info:Info||`` category, grab a ``||info:change score by [1]||``
|
|
125
26
|
block and snap it into the top of the **on B button pressed** container.
|
|
126
27
|
|
|
127
|
-
|
|
28
|
+
- :mouse pointer: Change the value in the new block from **1** to **-10**.
|
|
128
29
|
|
|
129
30
|
```blocks
|
|
130
31
|
controller.B.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
@@ -136,7 +37,7 @@ controller.B.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
|
136
37
|
```
|
|
137
38
|
|
|
138
39
|
|
|
139
|
-
## Step 2
|
|
40
|
+
## {Step 2}
|
|
140
41
|
|
|
141
42
|
**💡 Now we're onto something 💡**
|
|
142
43
|
|
|
@@ -146,11 +47,11 @@ upgrade the power.
|
|
|
146
47
|
|
|
147
48
|
---
|
|
148
49
|
|
|
149
|
-
|
|
50
|
+
- :mouse pointer: From ``||logic:Logic||``, choose the top
|
|
150
51
|
``||logic:if <true> then||`` container and drag it into the top of your
|
|
151
52
|
**on B button pressed** container already in the workspace.
|
|
152
53
|
|
|
153
|
-
|
|
54
|
+
- :mouse pointer: To compare values, open the ``||logic: Logic||``
|
|
154
55
|
category and grab a ``||logic: [0] [<] [0]||`` to replace **`<true>`**.
|
|
155
56
|
|
|
156
57
|
|
|
@@ -166,18 +67,18 @@ controller.B.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
|
166
67
|
})
|
|
167
68
|
```
|
|
168
69
|
|
|
169
|
-
## Step 3
|
|
70
|
+
## {Step 3}
|
|
170
71
|
|
|
171
72
|
We should check that score is greater than (or equal to) **10**
|
|
172
73
|
before we charge the player 10 points.
|
|
173
74
|
|
|
174
75
|
---
|
|
175
76
|
|
|
176
|
-
|
|
77
|
+
- :mouse pointer: To make sure the score is larger than (or equal to) 10, replace the first
|
|
177
78
|
**0** in ``||logic: [0] [<] [0]||`` with **10** and change **<**
|
|
178
79
|
to **≤**.
|
|
179
80
|
|
|
180
|
-
|
|
81
|
+
- :mouse pointer: Open the ``||info:Info||`` category and find the ``||info:score||`` value block.
|
|
181
82
|
Grab it and drop it in to replace the remaining **0** of the comparison argument.
|
|
182
83
|
|
|
183
84
|
|
|
@@ -194,14 +95,14 @@ controller.B.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
|
194
95
|
```
|
|
195
96
|
|
|
196
97
|
|
|
197
|
-
## Step 4
|
|
98
|
+
## {Step 4}
|
|
198
99
|
|
|
199
100
|
Now if the player has a large enough score, you can charge them
|
|
200
101
|
10 points and give them their extra power.
|
|
201
102
|
|
|
202
103
|
---
|
|
203
104
|
|
|
204
|
-
|
|
105
|
+
- :mouse pointer: The code to adjust the score and power are already at the bottom of the
|
|
205
106
|
**on B button pressed** container. Grab all of the code below and
|
|
206
107
|
drag it into the empty **if/then** container.
|
|
207
108
|
|
|
@@ -219,28 +120,28 @@ controller.B.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
|
219
120
|
```
|
|
220
121
|
|
|
221
122
|
|
|
222
|
-
## Step 6 @showdialog
|
|
123
|
+
## {Step 6 @showdialog}
|
|
223
124
|
|
|
224
125
|
**🎮 Give your game a try on the game screen 🎮**
|
|
225
126
|
|
|
226
127
|
It should do what you expect...as long as you have 10 points to spend!
|
|
227
128
|
|
|
228
129
|
|
|
229
|
-
## Step 7
|
|
130
|
+
## {Step 7}
|
|
230
131
|
|
|
231
132
|
Finally, we should let the player know if they don't have enough points to
|
|
232
133
|
buy the clicker.
|
|
233
134
|
|
|
234
135
|
---
|
|
235
136
|
|
|
236
|
-
|
|
137
|
+
- :mouse pointer: We already have a note that shows **if** the player has enough points.
|
|
237
138
|
Click the **⊕** at the bottom of the **if/then** container to create an **else** space
|
|
238
139
|
for code that runs when the **if** statement is not true.
|
|
239
140
|
|
|
240
|
-
|
|
141
|
+
- :mouse pointer: Now you have an **else** container. Grab another
|
|
241
142
|
``||game:show long text [" "] [bottom]||`` and drag it into the empty **else**.
|
|
242
143
|
|
|
243
|
-
|
|
144
|
+
- :mouse pointer: Click into the textarea of the new block and write a message to let your
|
|
244
145
|
player know that they didn't have enough points for an auto-clicker.
|
|
245
146
|
|
|
246
147
|
|
|
@@ -258,11 +159,97 @@ controller.B.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
|
258
159
|
})
|
|
259
160
|
```
|
|
260
161
|
|
|
261
|
-
## Finale
|
|
162
|
+
## {Finale}
|
|
262
163
|
|
|
263
164
|
**⚡️ Amazing ⚡️**
|
|
264
165
|
|
|
265
166
|
Now you have a clicker game with a simple shop. Give it a try on the game screen.
|
|
266
167
|
|
|
267
168
|
Click **Done** to return to the main page where you can share your game
|
|
268
|
-
with family and friends!
|
|
169
|
+
with family and friends!
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
```template
|
|
174
|
+
controller.B.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
175
|
+
power += 1
|
|
176
|
+
game.showLongText("You bought one extra click!", DialogLayout.Center)
|
|
177
|
+
})
|
|
178
|
+
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
179
|
+
info.changeScoreBy(power)
|
|
180
|
+
mySprite.startEffect(effects.spray, 100)
|
|
181
|
+
})
|
|
182
|
+
info.onCountdownEnd(function () {
|
|
183
|
+
game.over(true, effects.confetti)
|
|
184
|
+
})
|
|
185
|
+
let power = 0
|
|
186
|
+
let mySprite: Sprite = null
|
|
187
|
+
scene.setBackgroundColor(11)
|
|
188
|
+
info.startCountdown(10)
|
|
189
|
+
game.splash("Press (A) to earn clicks!")
|
|
190
|
+
mySprite = sprites.create(img`
|
|
191
|
+
.........bbbbb................
|
|
192
|
+
........bb111bb...............
|
|
193
|
+
.......b1111111b..............
|
|
194
|
+
......bb1111111bb....bbb......
|
|
195
|
+
...bbbbd11111111bbbbbb1bb.....
|
|
196
|
+
..bb111dd111111111111111b.....
|
|
197
|
+
.bb111111111111111111111b.....
|
|
198
|
+
.b1111111111111111d11111bb....
|
|
199
|
+
bb111111111111111d1111111bb...
|
|
200
|
+
b111111111111111d111111111bb..
|
|
201
|
+
bb111111111111111d111111111bb.
|
|
202
|
+
.bbb11ddd111111111d11111111bb.
|
|
203
|
+
...bbbbbd1111111111bbb11bbbb..
|
|
204
|
+
.......bb11111111bbb.bbbb.....
|
|
205
|
+
........bbb11111bb............
|
|
206
|
+
..........bbbbbbb.............
|
|
207
|
+
`, SpriteKind.Player)
|
|
208
|
+
power = 1
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
```ghost
|
|
213
|
+
|
|
214
|
+
controller.B.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
215
|
+
if (10 <= info.score()) {
|
|
216
|
+
let mySprite: Sprite = null
|
|
217
|
+
info.changeScoreBy(-10)
|
|
218
|
+
power +=1
|
|
219
|
+
mySprite.say("You've purchased a super-clicker")
|
|
220
|
+
game.showLongText("You bought an auto-clicker!", DialogLayout.Center)
|
|
221
|
+
|
|
222
|
+
}
|
|
223
|
+
})
|
|
224
|
+
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
225
|
+
info.changeScoreBy(clicks)
|
|
226
|
+
})
|
|
227
|
+
let autoClicks = 0
|
|
228
|
+
let clicks = 0
|
|
229
|
+
clicks = 1
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
game.splash("")
|
|
233
|
+
game.setDialogTextColor(0)
|
|
234
|
+
game.setDialogCursor(img`
|
|
235
|
+
.
|
|
236
|
+
`)
|
|
237
|
+
})
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
```assetjson
|
|
245
|
+
{
|
|
246
|
+
"README.md": " ",
|
|
247
|
+
"images.g.jres": "{\n \"image2\": {\n \"data\": \"hwQeABAAAAAAAAAAuwsAAAAAALsbuwAAAACwGxGxAAAAALsREbELAAAAGxEREQsAAAAbERERCwAAsBsREdELAAC73RER0bsAsBHRERHRvQu7ERERERERCxsRERERERG7GxEREREREbEbERERERERsbsRERERERGxsBEREREREbEAuxERERERsQCwGxHRERG7AAAbER0dsQsAABvREdGxAAAAGxEREbsAAAAbERERCwAAsBsRERG7AACwEREREbEAALAbERERsQAAALu7ERG7AAAAALAbEQsAAAAAALsRCwAAAAAAsLsLAAAAAAAAuwAAAAAAAAAAAAA=\",\n \"mimeType\": \"image/x-mkcd-f4\",\n \"displayName\": \"Cloud\"\n },\n \"image3\": \"hwQeABAAAAAAAAAAuwsAAAAAALsbuwAAAACwGxGxAAAAALsREbELAAAAGxEREQsAAAAbERERCwAAsBsREdELAAC73RER0bsAsBHRERHRvQu7ERERERERCxsRERERERG7GxEREREREbEbERERERERsbsRERERERGxsBEREREREbEAuxERERERsQCwGxHRERG7AAAbER0dsQsAABvREdGxAAAAGxEREbsAAAAbERERCwAAsBsRERG7AACwEREREbEAALAbERERsQAAALu7ERG7AAAAALAbEQsAAAAAALsRCwAAAAAAsLsLAAAAAAAAuwAAAAAAAAAAAAA=\",\n \"*\": {\n \"mimeType\": \"image/x-mkcd-f4\",\n \"dataEncoding\": \"base64\",\n \"namespace\": \"myImages\"\n }\n}",
|
|
248
|
+
"images.g.ts": "// Auto-generated code. Do not edit.\nnamespace myImages {\n\n helpers._registerFactory(\"image\", function(name: string) {\n switch(helpers.stringTrim(name)) {\n case \"image2\":\n case \"Cloud\":return img`\n.........bbbbb................\n........bb111bb...............\n.......b1111111b..............\n......bb1111111bb....bbb......\n...bbbbd11111111bbbbbb1bb.....\n..bb111dd111111111111111b.....\n.bb111111111111111111111b.....\n.b1111111111111111d11111bb....\nbb111111111111111d1111111bb...\nb111111111111111d111111111bb..\nbb111111111111111d111111111bb.\n.bbb11ddd111111111d11111111bb.\n...bbbbbd1111111111bbb11bbbb..\n.......bb11111111bbb.bbbb.....\n........bbb11111bb............\n..........bbbbbbb.............\n`;\n case \"image3\":return img`\n.........bbbbb................\n........bb111bb...............\n.......b1111111b..............\n......bb1111111bb....bbb......\n...bbbbd11111111bbbbbb1bb.....\n..bb111dd111111111111111b.....\n.bb111111111111111111111b.....\n.b1111111111111111d11111bb....\nbb111111111111111d1111111bb...\nb111111111111111d111111111bb..\nbb111111111111111d111111111bb.\n.bbb11ddd111111111d11111111bb.\n...bbbbbd1111111111bbb11bbbb..\n.......bb11111111bbb.bbbb.....\n........bbb11111bb............\n..........bbbbbbb.............\n`;\n }\n return null;\n })\n\n helpers._registerFactory(\"animation\", function(name: string) {\n switch(helpers.stringTrim(name)) {\n\n }\n return null;\n })\n\n}\n// Auto-generated code. Do not edit.\n",
|
|
249
|
+
"main.blocks": "<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable type=\"KIND_SpriteKind\" id=\"4B?GV*)eD5DUvikVNk$t\">Player</variable><variable type=\"KIND_SpriteKind\" id=\"6j5)LMVdgl^XeJC*L.Dw\">Projectile</variable><variable type=\"KIND_SpriteKind\" id=\"TJcarl[PVtMHvEjiAkQ=\">Food</variable><variable type=\"KIND_SpriteKind\" id=\"l9d!xsEb8*84@?y9RWQJ\">Enemy</variable><variable id=\"OhzSzwl78,9[a~*FxDB+\">mySprite</variable><variable id=\"I?4@gJV,8)yi2RplwDBf\">power</variable><variable id=\"?SrrdKP|Z)`PL`-|XKVQ\">mySprite2</variable></variables><block type=\"pxt-on-start\" x=\"0\" y=\"0\"><statement name=\"HANDLER\"><block type=\"gamesetbackgroundcolor\"><value name=\"color\"><shadow type=\"colorindexpicker\"><field name=\"index\">11</field></shadow></value><next><block type=\"variables_set\"><field name=\"VAR\" id=\"I?4@gJV,8)yi2RplwDBf\">power</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">1</field></shadow></value><next><block type=\"gamecountdown\"><value name=\"duration\"><shadow type=\"math_number\"><field name=\"NUM\">10</field></shadow></value><next><block type=\"gameSplash\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" _expanded=\"0\" _input_init=\"true\"></mutation><value name=\"title\"><shadow type=\"text\"><field name=\"TEXT\">Press (A) to earn clicks!</field></shadow></value><value name=\"subtitle\"><shadow type=\"text\"><field name=\"TEXT\"/></shadow></value></block></next></block></next></block></next></block></statement></block><block type=\"keyonevent\" x=\"410\" y=\"10\"><field name=\"button\">controller.B</field><field name=\"event\">ControllerButtonEvent.Pressed</field><statement name=\"HANDLER\"><block type=\"hudChangeScoreBy\"><value name=\"value\"><shadow type=\"math_number\"><field name=\"NUM\">-20</field></shadow></value><next><block type=\"variables_change\"><field name=\"VAR\" id=\"I?4@gJV,8)yi2RplwDBf\">power</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">1</field></shadow></value><next><block type=\"game_show_long_text\"><field name=\"layout\">DialogLayout.Top</field><value name=\"str\"><shadow type=\"text\"><field name=\"TEXT\">You bought one extra click!</field></shadow></value></block></next></block></next></block></statement></block><block type=\"gamecountdownevent\" x=\"290\" y=\"270\"><statement name=\"HANDLER\"><block type=\"gameOver\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" _expanded=\"1\" _input_init=\"true\"></mutation><field name=\"effect\">effects.confetti</field><value name=\"win\"><shadow type=\"toggleWinLose\"><field name=\"win\">true</field></shadow></value></block></statement></block><block type=\"keyonevent\" x=\"30\" y=\"410\"><field name=\"button\">controller.A</field><field name=\"event\">ControllerButtonEvent.Pressed</field><statement name=\"HANDLER\"><block type=\"variables_set\"><field name=\"VAR\" id=\"OhzSzwl78,9[a~*FxDB+\">mySprite</field><value name=\"VALUE\"><shadow xmlns=\"http://www.w3.org/1999/xhtml\" type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"spritescreate\"><value name=\"img\"><shadow type=\"screen_image_picker\"><field name=\"img\">img`\n.........bbbbb................\n........bb111bb...............\n.......b1111111b..............\n......bb1111111bb....bbb......\n...bbbbd11111111bbbbbb1bb.....\n..bb111dd111111111111111b.....\n.bb111111111111111111111b.....\n.b1111111111111111d11111bb....\nbb111111111111111d1111111bb...\nb111111111111111d111111111bb..\nbb111111111111111d111111111bb.\n.bbb11ddd111111111d11111111bb.\n...bbbbbd1111111111bbb11bbbb..\n.......bb11111111bbb.bbbb.....\n........bbb11111bb............\n..........bbbbbbb.............\n`</field><data>{\"commentRefs\":[],\"fieldData\":{\"img\":\"myImages.image3\"}}</data></shadow></value><value name=\"kind\"><shadow type=\"spritekind\"><field name=\"MEMBER\">Player</field></shadow></value></block></value><next><block type=\"startEffectOnSprite\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" _expanded=\"0\" _input_init=\"false\"></mutation><field name=\"effect\">effects.spray</field><value name=\"sprite\"><block type=\"variables_get\"><field name=\"VAR\" id=\"OhzSzwl78,9[a~*FxDB+\">mySprite</field></block></value><next><block type=\"hudChangeScoreBy\"><value name=\"value\"><shadow type=\"math_number\"><field name=\"NUM\">1</field></shadow><block type=\"variables_get\"><field name=\"VAR\" id=\"I?4@gJV,8)yi2RplwDBf\">power</field></block></value></block></next></block></next></block></statement></block></xml>",
|
|
250
|
+
"main.ts": "controller.B.onEvent(ControllerButtonEvent.Pressed, function () {\n info.changeScoreBy(-20)\n power2 += 1\n game.showLongText(\"You bought one extra click!\", DialogLayout.Top)\n})\ncontroller.A.onEvent(ControllerButtonEvent.Pressed, function () {\n mySprite = sprites.create(img`\n .........bbbbb................\n ........bb111bb...............\n .......b1111111b..............\n ......bb1111111bb....bbb......\n ...bbbbd11111111bbbbbb1bb.....\n ..bb111dd111111111111111b.....\n .bb111111111111111111111b.....\n .b1111111111111111d11111bb....\n bb111111111111111d1111111bb...\n b111111111111111d111111111bb..\n bb111111111111111d111111111bb.\n .bbb11ddd111111111d11111111bb.\n ...bbbbbd1111111111bbb11bbbb..\n .......bb11111111bbb.bbbb.....\n ........bbb11111bb............\n ..........bbbbbbb.............\n `, SpriteKind.Player)\n mySprite.startEffect(effects.spray)\n info.changeScoreBy(power2)\n})\ninfo.onCountdownEnd(function () {\n game.over(true, effects.confetti)\n})\nlet mySprite: Sprite = null\nlet power2 = 0\nscene.setBackgroundColor(11)\npower2 = 1\ninfo.startCountdown(10)\ngame.splash(\"Press (A) to earn clicks!\")\n",
|
|
251
|
+
"pxt.json": "{\n \"name\": \"clicker-withTimer\",\n \"description\": \"\",\n \"dependencies\": {\n \"device\": \"*\"\n },\n \"files\": [\n \"main.blocks\",\n \"main.ts\",\n \"README.md\",\n \"tilemap.g.jres\",\n \"tilemap.g.ts\",\n \"images.g.jres\",\n \"images.g.ts\"\n ],\n \"targetVersions\": {\n \"branch\": \"v1.2.16\",\n \"tag\": \"v1.2.16\",\n \"commits\": \"https://github.com/microsoft/pxt-arcade/commits/971a86b03314f200ceb1a951ad277d1d6b8c1e23\",\n \"target\": \"1.2.16\",\n \"pxt\": \"6.2.30\"\n },\n \"preferredEditor\": \"blocksprj\"\n}\n",
|
|
252
|
+
"tilemap.g.jres": "{\n \"transparency16\": {\n \"data\": \"hwQQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\",\n \"mimeType\": \"image/x-mkcd-f4\",\n \"tilemapTile\": true\n },\n \"*\": {\n \"mimeType\": \"image/x-mkcd-f4\",\n \"dataEncoding\": \"base64\",\n \"namespace\": \"myTiles\"\n }\n}",
|
|
253
|
+
"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"
|
|
254
|
+
}
|
|
255
|
+
```
|
|
@@ -46,7 +46,7 @@ forever(function () {
|
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
## Intro @showdialog
|
|
49
|
+
## {Intro @showdialog}
|
|
50
50
|
|
|
51
51
|
Ready to give your **W,A,S,D** keys a workout?
|
|
52
52
|
|
|
@@ -56,7 +56,7 @@ Let's create a game that brings back some of the iconic arcade style that we lov
|
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
## Step 2
|
|
59
|
+
## {Step 2}
|
|
60
60
|
|
|
61
61
|
**🐤 This game needs a** [__*sprite*__](#sprote "a dynamic 2-D image")**. 🐤**
|
|
62
62
|
|
|
@@ -100,7 +100,7 @@ let mySprite = sprites.create(img`
|
|
|
100
100
|
|
|
101
101
|
|
|
102
102
|
|
|
103
|
-
## Step 3
|
|
103
|
+
## {Step 3}
|
|
104
104
|
|
|
105
105
|
**🤩 Fabulous 🤩**
|
|
106
106
|
|
|
@@ -147,7 +147,7 @@ controller.moveSprite(mySprite, 0, 100)
|
|
|
147
147
|
|
|
148
148
|
|
|
149
149
|
|
|
150
|
-
## Step 4
|
|
150
|
+
## {Step 4}
|
|
151
151
|
|
|
152
152
|
**💰 The sprite needs something to collect 💰**
|
|
153
153
|
|
|
@@ -191,7 +191,7 @@ forever(function () {
|
|
|
191
191
|
|
|
192
192
|
|
|
193
193
|
|
|
194
|
-
## Step 5
|
|
194
|
+
## {Step 5}
|
|
195
195
|
|
|
196
196
|
**😯 Now you have a steady stream of income 😯**
|
|
197
197
|
|
|
@@ -232,7 +232,7 @@ forever(function () {
|
|
|
232
232
|
|
|
233
233
|
|
|
234
234
|
|
|
235
|
-
## Step 6
|
|
235
|
+
## {Step 6}
|
|
236
236
|
|
|
237
237
|
**This is looking great, but the coins still hover around the top.**
|
|
238
238
|
|
|
@@ -267,12 +267,12 @@ forever(function () {
|
|
|
267
267
|
|
|
268
268
|
```
|
|
269
269
|
|
|
270
|
-
## Step 7 @showdialog
|
|
270
|
+
## {Step 7 @showdialog}
|
|
271
271
|
|
|
272
272
|
**🎮 Give your game a try in the game screen 🎮**
|
|
273
273
|
|
|
274
274
|
|
|
275
|
-
## Step 8
|
|
275
|
+
## {Step 8}
|
|
276
276
|
|
|
277
277
|
**Notice anything missing?**
|
|
278
278
|
|
|
@@ -296,7 +296,7 @@ sprites.onOverlap(SpriteKind.Player, SpriteKind.Projectile, function (sprite, ot
|
|
|
296
296
|
|
|
297
297
|
|
|
298
298
|
|
|
299
|
-
## Step 9
|
|
299
|
+
## {Step 9}
|
|
300
300
|
|
|
301
301
|
Now we have a container for code that runs when the sprite
|
|
302
302
|
overlaps a projectile.
|
|
@@ -322,7 +322,7 @@ sprites.onOverlap(SpriteKind.Player, SpriteKind.Projectile, function (sprite, ot
|
|
|
322
322
|
```
|
|
323
323
|
|
|
324
324
|
|
|
325
|
-
## Step 10
|
|
325
|
+
## {Step 10}
|
|
326
326
|
|
|
327
327
|
**🏆 Keeping score 🏆**
|
|
328
328
|
|
|
@@ -345,7 +345,7 @@ sprites.onOverlap(SpriteKind.Player, SpriteKind.Projectile, function (sprite, ot
|
|
|
345
345
|
```
|
|
346
346
|
|
|
347
347
|
|
|
348
|
-
## Step 11
|
|
348
|
+
## {Step 11}
|
|
349
349
|
|
|
350
350
|
**🎆 Congrats 🎆**
|
|
351
351
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Design a Background
|
|
2
2
|
|
|
3
|
-
## Introduction @showdialog
|
|
3
|
+
## {Introduction @showdialog}
|
|
4
4
|
|
|
5
5
|
Let's give your hero a world to protect!
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
## Add a background
|
|
10
|
+
## {Add a background}
|
|
11
11
|
|
|
12
12
|
**We're going to need a background image.**
|
|
13
13
|
|
|
@@ -145,7 +145,7 @@ scene.setBackgroundImage(img`
|
|
|
145
145
|
`)
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
-
## Edit the background
|
|
148
|
+
## {Edit the background}
|
|
149
149
|
|
|
150
150
|
**🖼️ Time to get creative 🖼️**
|
|
151
151
|
|
|
@@ -282,7 +282,7 @@ scene.setBackgroundImage(img`
|
|
|
282
282
|
```
|
|
283
283
|
|
|
284
284
|
|
|
285
|
-
## Play @@showdialog
|
|
285
|
+
## {Play @@showdialog}
|
|
286
286
|
|
|
287
287
|
**🎮 Play your game 🎮**
|
|
288
288
|
|
|
@@ -293,7 +293,7 @@ scene.setBackgroundImage(img`
|
|
|
293
293
|
► Feel free to return to the **Image Editor** and change it until you get it just the way you want it!
|
|
294
294
|
|
|
295
295
|
|
|
296
|
-
## Decorative sprites
|
|
296
|
+
## {Decorative sprites}
|
|
297
297
|
|
|
298
298
|
** 🐚 Add some sprites to decorate your game 🐚**
|
|
299
299
|
|
|
@@ -362,7 +362,7 @@ let mySprite2 = sprites.create(img`
|
|
|
362
362
|
|
|
363
363
|
```
|
|
364
364
|
|
|
365
|
-
## Update sprite y-position
|
|
365
|
+
## {Update sprite y-position}
|
|
366
366
|
|
|
367
367
|
**You can put your sprites wherever you want...**
|
|
368
368
|
|
|
@@ -441,7 +441,7 @@ mySprite2.setPosition(randint(5, 155), 115)
|
|
|
441
441
|
|
|
442
442
|
```
|
|
443
443
|
|
|
444
|
-
## Add More
|
|
444
|
+
## {Add More }
|
|
445
445
|
|
|
446
446
|
**You can add more decorations the same way!**
|
|
447
447
|
|
|
@@ -449,7 +449,7 @@ Just give each sprite a unique name and make sure
|
|
|
449
449
|
you select that name from the dropdown when positioning each sprite.
|
|
450
450
|
|
|
451
451
|
|
|
452
|
-
## Conclusion
|
|
452
|
+
## {Conclusion }
|
|
453
453
|
|
|
454
454
|
**🎉 Congratulations 🎉**
|
|
455
455
|
|
|
@@ -202,7 +202,7 @@ forever(function () {
|
|
|
202
202
|
```
|
|
203
203
|
|
|
204
204
|
|
|
205
|
-
## Intro @showdialog
|
|
205
|
+
## {Intro @showdialog}
|
|
206
206
|
|
|
207
207
|
You've made a collector game, now let's add some
|
|
208
208
|
special touches to make it even more fun.
|
|
@@ -211,7 +211,7 @@ special touches to make it even more fun.
|
|
|
211
211
|
|
|
212
212
|
|
|
213
213
|
|
|
214
|
-
## Step 1
|
|
214
|
+
## {Step 1}
|
|
215
215
|
|
|
216
216
|
The code for a basic collector is already in the workspace, but a few extra
|
|
217
217
|
blocks could make it amazing.
|
|
@@ -251,7 +251,7 @@ controller.moveSprite(mySprite, 0, 100)
|
|
|
251
251
|
|
|
252
252
|
|
|
253
253
|
|
|
254
|
-
## Step 2
|
|
254
|
+
## {Step 2}
|
|
255
255
|
|
|
256
256
|
**If the game gets wild, our sprite might leave the screen.**
|
|
257
257
|
Let's prevent that.
|
|
@@ -291,7 +291,7 @@ mySprite.setStayInScreen(true)
|
|
|
291
291
|
```
|
|
292
292
|
|
|
293
293
|
|
|
294
|
-
## Step 3
|
|
294
|
+
## {Step 3}
|
|
295
295
|
|
|
296
296
|
**🕔 Does this game feel long to you? 🕔**
|
|
297
297
|
|
|
@@ -332,7 +332,7 @@ info.startCountdown(15)
|
|
|
332
332
|
```
|
|
333
333
|
|
|
334
334
|
|
|
335
|
-
## Step 4
|
|
335
|
+
## {Step 4}
|
|
336
336
|
|
|
337
337
|
**🥇 Everyone's a winner 🥇**
|
|
338
338
|
|
|
@@ -355,7 +355,7 @@ info.onCountdownEnd(function () {
|
|
|
355
355
|
```
|
|
356
356
|
|
|
357
357
|
|
|
358
|
-
## Step 5
|
|
358
|
+
## {Step 5}
|
|
359
359
|
|
|
360
360
|
**🎊 Little celebrations 🎊**
|
|
361
361
|
|
|
@@ -382,7 +382,7 @@ sprites.onOverlap(SpriteKind.Player, SpriteKind.Projectile, function (sprite, ot
|
|
|
382
382
|
```
|
|
383
383
|
|
|
384
384
|
|
|
385
|
-
## Step 6
|
|
385
|
+
## {Step 6}
|
|
386
386
|
|
|
387
387
|
Finally, let's make the timing of the coins less predictable using random numbers.
|
|
388
388
|
|
|
@@ -414,7 +414,7 @@ forever(function () {
|
|
|
414
414
|
})
|
|
415
415
|
```
|
|
416
416
|
|
|
417
|
-
## Step 7
|
|
417
|
+
## {Step 7}
|
|
418
418
|
|
|
419
419
|
There you have it...a collector game with style AND class.
|
|
420
420
|
|
|
@@ -131,7 +131,7 @@ forever(function () {
|
|
|
131
131
|
```
|
|
132
132
|
|
|
133
133
|
|
|
134
|
-
## Intro @showdialog
|
|
134
|
+
## {Intro @showdialog}
|
|
135
135
|
|
|
136
136
|
Collecting things is great, but avoiding danger is more exciting.
|
|
137
137
|
|
|
@@ -141,7 +141,7 @@ This tutorial will show you how to add menacing elements to your game.
|
|
|
141
141
|
|
|
142
142
|
|
|
143
143
|
|
|
144
|
-
## Step 1
|
|
144
|
+
## {Step 1}
|
|
145
145
|
|
|
146
146
|
The code for a collector game is already in the workspace.
|
|
147
147
|
We can build on this to make something that requires extra skill.
|
|
@@ -182,7 +182,7 @@ forever(function () {
|
|
|
182
182
|
```
|
|
183
183
|
|
|
184
184
|
|
|
185
|
-
## Step 2
|
|
185
|
+
## {Step 2}
|
|
186
186
|
|
|
187
187
|
Our new enemy isn't quite ready. Let's make sure to get all the blocks
|
|
188
188
|
in the new **forever** loop pointed to the right thing.
|
|
@@ -223,7 +223,7 @@ forever(function () {
|
|
|
223
223
|
```
|
|
224
224
|
|
|
225
225
|
|
|
226
|
-
## Step 3
|
|
226
|
+
## {Step 3}
|
|
227
227
|
|
|
228
228
|
If you play your game right now, you'll see that the rocks and the coins
|
|
229
229
|
fly out at about the same rate. Let's add some variation.
|
|
@@ -263,7 +263,7 @@ forever(function () {
|
|
|
263
263
|
```
|
|
264
264
|
|
|
265
265
|
|
|
266
|
-
## Step 4
|
|
266
|
+
## {Step 4}
|
|
267
267
|
|
|
268
268
|
**😲 Uh-Oh 😲**
|
|
269
269
|
|
|
@@ -309,7 +309,7 @@ forever(function () {
|
|
|
309
309
|
})
|
|
310
310
|
```
|
|
311
311
|
|
|
312
|
-
## Step 5
|
|
312
|
+
## {Step 5}
|
|
313
313
|
|
|
314
314
|
**😈 Wicked 😈**
|
|
315
315
|
|
|
@@ -338,7 +338,7 @@ sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSp
|
|
|
338
338
|
```
|
|
339
339
|
|
|
340
340
|
|
|
341
|
-
## Step 6
|
|
341
|
+
## {Step 6}
|
|
342
342
|
|
|
343
343
|
At this point, the player is still awarded points when they hit a rock.
|
|
344
344
|
|
|
@@ -364,7 +364,7 @@ sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSp
|
|
|
364
364
|
```
|
|
365
365
|
|
|
366
366
|
|
|
367
|
-
## Step 7
|
|
367
|
+
## {Step 7}
|
|
368
368
|
|
|
369
369
|
**What an amazing creation!**
|
|
370
370
|
|