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
|
@@ -9,15 +9,22 @@ In this tutorial, you'll prepare your ship for a journey into space!
|
|
|
9
9
|
|
|
10
10
|

|
|
11
11
|
|
|
12
|
-
## Set the scene
|
|
13
|
-
|
|
12
|
+
## 2. Set the scene
|
|
13
|
+
**🔭 Time to give 'em a view**
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
- :tree: From the ``||scene:Scene||`` category, drag
|
|
18
|
+
``||scene:set background image to [ ]||``
|
|
19
|
+
into the
|
|
20
|
+
``||loops:on start||``
|
|
21
|
+
container already in the workspace.
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
_💡 Having trouble finding the block you need? Look to the left of the instructions for the icon of the toolbox category where your block lives!_
|
|
20
24
|
|
|
25
|
+
- :paint brush: Next, click the grey box and toggle to **My Assets** to choose the **Galaxy** background, then click **Done**.
|
|
26
|
+
|
|
27
|
+

|
|
21
28
|
|
|
22
29
|
```blocks
|
|
23
30
|
// @highlight
|
|
@@ -31,16 +38,21 @@ scene.setBackgroundImage(assets.image`Galaxy`)
|
|
|
31
38
|
|
|
32
39
|
|
|
33
40
|
|
|
34
|
-
## Make it fly
|
|
41
|
+
## 3. Make it fly
|
|
35
42
|
**🚀 Make it fly 🚀**
|
|
36
43
|
|
|
37
44
|
---
|
|
38
45
|
|
|
39
|
-
|
|
46
|
+
- :arrows alternate: Grab
|
|
47
|
+
``||scroller:scroll background with vx [-50] vy [-50]||``
|
|
48
|
+
and drop it in to **the end** of the
|
|
49
|
+
``||loops:on start||`` container.
|
|
50
|
+
|
|
51
|
+
_💡 Remember, the icon to the left of the instructions shows the same icon as the toolbox category for the block you need._
|
|
40
52
|
|
|
41
|
-
|
|
53
|
+
- :mouse pointer: To keep the background from scrolling sideways, change **vx** to **0**.
|
|
42
54
|
|
|
43
|
-
|
|
55
|
+
- :mouse pointer: To set a nice, slow vertical pace, change **vy** to **10**.
|
|
44
56
|
|
|
45
57
|
```blocks
|
|
46
58
|
scene.setBackgroundImage(assets.image`Galaxy`)
|
|
@@ -49,15 +61,19 @@ scroller.scrollBackgroundWithSpeed(0, 10)
|
|
|
49
61
|
```
|
|
50
62
|
|
|
51
63
|
|
|
52
|
-
##
|
|
53
|
-
|
|
64
|
+
## 4. Choose your ship
|
|
65
|
+
**Time to pick your ship!**
|
|
54
66
|
|
|
55
67
|
---
|
|
56
68
|
|
|
57
|
-
|
|
69
|
+
- :paper plane: Drag
|
|
70
|
+
``||variables:set [mySprite] to sprite [ ] of kind [Player]||``
|
|
71
|
+
to **the end** of the
|
|
72
|
+
``||loops:on start||`` container.
|
|
58
73
|
|
|
59
|
-
|
|
60
|
-
``||variables:set [mySprite] to sprite [ ] of kind [Player]||``,
|
|
74
|
+
- :paint brush: Click on the grey box in the middle of
|
|
75
|
+
``||variables:set [mySprite] to sprite [ ] of kind [Player]||``,
|
|
76
|
+
then toggle to **My Assets** and choose the **Rocket**.
|
|
61
77
|
|
|
62
78
|
|
|
63
79
|
```blocks
|
|
@@ -69,17 +85,17 @@ let mySprite = sprites.create(assets.image`Rocket`, SpriteKind.Player)
|
|
|
69
85
|
|
|
70
86
|
|
|
71
87
|
|
|
72
|
-
## Control your ship
|
|
88
|
+
## 5. Control your ship
|
|
73
89
|
|
|
74
|
-
🌟 Let's get your ship moving
|
|
90
|
+
🌟 **Let's get your ship moving**
|
|
75
91
|
|
|
76
92
|
---
|
|
77
93
|
|
|
78
|
-
|
|
79
|
-
|
|
94
|
+
- :game: Find the
|
|
95
|
+
``||controller:move [mySprite] with buttons ⊕||``
|
|
96
|
+
block and drag it into the bottom of the
|
|
97
|
+
``||loops:on start||`` container.
|
|
80
98
|
|
|
81
|
-
** Now try moving your ship around the game screen! **
|
|
82
|
-
Your ship will move with the joystick, arrow keys, or **W A S D** keys.
|
|
83
99
|
|
|
84
100
|
|
|
85
101
|
|
|
@@ -91,15 +107,30 @@ mySprite = sprites.create(assets.image`Rocket`, SpriteKind.Player)
|
|
|
91
107
|
controller.moveSprite(mySprite)
|
|
92
108
|
```
|
|
93
109
|
|
|
94
|
-
|
|
110
|
+
|
|
111
|
+
## 6. Try It
|
|
112
|
+
|
|
113
|
+
**Click the Game Window Tab (Above)**
|
|
114
|
+

|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
Try moving your ship around the game screen! Your ship will move with the joypad, arrow keys, or **W A S D** keys.
|
|
119
|
+
|
|
120
|
+
What happens when you hold one arrow down for a long time?
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
## 7. Stay on Screen
|
|
95
125
|
|
|
96
126
|
**Uh-oh, if you move off screen, your ship disappears!**
|
|
97
127
|
|
|
98
128
|
---
|
|
99
129
|
|
|
100
|
-
|
|
101
|
-
the
|
|
102
|
-
|
|
130
|
+
- :paper plane: To keep your ship from exploring beyond the edges, find
|
|
131
|
+
the
|
|
132
|
+
``||sprites:set [mySprite] stay in screen <on>||``
|
|
133
|
+
block and snap it in at the end of the program.
|
|
103
134
|
|
|
104
135
|
|
|
105
136
|
|
|
@@ -115,29 +146,31 @@ mySprite.setStayInScreen(true)
|
|
|
115
146
|
```
|
|
116
147
|
|
|
117
148
|
|
|
118
|
-
##
|
|
149
|
+
## 8. Test It
|
|
119
150
|
|
|
120
151
|
**Great Job!**
|
|
121
152
|
|
|
153
|
+
---
|
|
122
154
|
|
|
123
|
-
Now
|
|
155
|
+
Now test your project on the game screen!
|
|
124
156
|
|
|
125
157
|
Is everything how you want it? You can always go back and edit steps if you discover you'd like them to work differently.
|
|
126
158
|
|
|
127
159
|
|
|
128
160
|
|
|
129
|
-
##
|
|
161
|
+
## 9. Finale
|
|
130
162
|
|
|
131
163
|
** 🚀 That's it! 🚀**
|
|
132
164
|
|
|
133
165
|
You're all set to travel the universe!
|
|
134
166
|
|
|
135
|
-
|
|
136
|
-
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
Click **Done** to return to the main skillmap where you can move on to discover how to launch projectiles!
|
|
137
170
|
|
|
138
171
|
|
|
139
172
|
```package
|
|
140
|
-
arcade-background-scroll=github:microsoft/arcade-background-scroll/
|
|
173
|
+
arcade-background-scroll=github:microsoft/arcade-background-scroll#926e12eefffd09d453c7cde73f8d6ebd0e666d9d/
|
|
141
174
|
```
|
|
142
175
|
|
|
143
176
|
|
|
@@ -158,6 +191,7 @@ mySprite.y = 100
|
|
|
158
191
|
|
|
159
192
|
```
|
|
160
193
|
|
|
194
|
+
|
|
161
195
|
```assetjson
|
|
162
196
|
{
|
|
163
197
|
"README.md": " ",
|
|
@@ -9,17 +9,17 @@ In this tutorial, you'll equip your ship with [__*projectiles*__](#projected "a
|
|
|
9
9
|

|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
## Customize
|
|
12
|
+
## 2. Customize Sprites
|
|
13
13
|
|
|
14
|
-
**🚀 The workspace already has the code for a flying ship
|
|
14
|
+
**🚀 The workspace already has the code for a flying ship**
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
Play with your project in the game screen to make sure it works the way you expect.
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
## Add a
|
|
22
|
+
## 3. Add a Button Event
|
|
23
23
|
|
|
24
24
|
**Time for action!**
|
|
25
25
|
|
|
@@ -27,18 +27,22 @@ Let's launch projectiles when the **Ⓐ** button is pressed!
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
- :game: Drag an
|
|
31
|
+
``||controller:on [A] button pressed ||``
|
|
32
|
+
container into the workspace.
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
``||variables:set [projectile] to projectile [ ] from [mySprite] with vx [50] vy [50]||``
|
|
34
|
-
inside the new
|
|
34
|
+
- :paper plane: Snap
|
|
35
|
+
``||variables:set [projectile] to projectile [ ] from [mySprite] with vx [50] vy [50]||``
|
|
36
|
+
inside the new
|
|
37
|
+
``||controller:on [A] button pressed ||``
|
|
38
|
+
container.
|
|
35
39
|
|
|
36
|
-
|
|
40
|
+
- :paint brush: Click the grey box inside of the new projectile block and toggle to **My Assets** to choose one of the **Dart** sprites.
|
|
37
41
|
|
|
38
42
|
---
|
|
39
43
|
|
|
40
|
-
|
|
41
|
-
by pressing the **Ⓐ** button. What happens?
|
|
44
|
+
_💡 Run your code on the game screen and launch a few projectiles
|
|
45
|
+
by pressing the **Ⓐ** button. What happens?_
|
|
42
46
|
|
|
43
47
|
|
|
44
48
|
```blocks
|
|
@@ -72,9 +76,9 @@ In MakeCode Arcade, we call this [__*velocity*__](#veloc "speed in a given direc
|
|
|
72
76
|

|
|
73
77
|
|
|
74
78
|
|
|
75
|
-
## Create a
|
|
79
|
+
## 6. Create a Projectile
|
|
76
80
|
|
|
77
|
-
Play with the __vx__ and __vy__ values of the projectile until
|
|
81
|
+
Play with the __vx__ and __vy__ values of the projectile until the lasers are flying straight up at a decent speed.
|
|
78
82
|
|
|
79
83
|
```blocks
|
|
80
84
|
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
@@ -82,24 +86,26 @@ controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
|
82
86
|
})
|
|
83
87
|
```
|
|
84
88
|
|
|
85
|
-
## Custom
|
|
89
|
+
## 7. Custom Effects
|
|
86
90
|
|
|
87
|
-
|
|
91
|
+
**Now for some special effects**
|
|
92
|
+
💥 💥 💥
|
|
88
93
|
|
|
89
94
|
---
|
|
90
95
|
|
|
91
|
-
|
|
92
|
-
``||sprites:[mySprite] start [spray] effect
|
|
93
|
-
|
|
96
|
+
- :paper plane: Find
|
|
97
|
+
``||sprites:[mySprite] start [spray] effect ➕||``
|
|
98
|
+
and snap it in at **the end** of the
|
|
99
|
+
``||controller:on [A] button pressed ||``
|
|
100
|
+
container.
|
|
94
101
|
|
|
95
|
-
|
|
96
|
-
want the effects on your projectiles instead of on your ship.
|
|
102
|
+
- :mouse pointer: Change ``||variables:mySprite||`` to ``||variables:projectile||`` if you want the effects on your projectiles instead of on your ship.
|
|
97
103
|
|
|
98
|
-
|
|
104
|
+
- :mouse pointer: Try different options from the ``||sprites:[spray]||`` dropdown menu and choose the one you like best!
|
|
99
105
|
|
|
100
106
|
---
|
|
101
107
|
|
|
102
|
-
|
|
108
|
+
_💡 Click the➕ button on the ``||sprites:[mySprite] start [spray] effect ➕||`` block to change the time on the effect from 500 ms to **100** ms for a smoother experience._
|
|
103
109
|
|
|
104
110
|
|
|
105
111
|
|
|
@@ -111,20 +117,22 @@ controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
|
111
117
|
```
|
|
112
118
|
|
|
113
119
|
|
|
114
|
-
##
|
|
120
|
+
## Finale
|
|
115
121
|
|
|
116
122
|
🎆 **Congratulations** 🎆
|
|
117
123
|
|
|
124
|
+
---
|
|
125
|
+
|
|
118
126
|
You can now use the direction buttons to move your space plane and
|
|
119
127
|
press **Ⓐ** to lauch projectiles!
|
|
120
128
|
|
|
121
|
-
Play your game on the game screen, then click **Done** to return to the main
|
|
129
|
+
Play your game on the game screen, then click **Done** to return to the main skillmap where you can carry on to find out how to add enemies to your project!
|
|
122
130
|
|
|
123
131
|
|
|
124
132
|
|
|
125
133
|
|
|
126
134
|
```package
|
|
127
|
-
arcade-background-scroll=github:microsoft/arcade-background-scroll/
|
|
135
|
+
arcade-background-scroll=github:microsoft/arcade-background-scroll#926e12eefffd09d453c7cde73f8d6ebd0e666d9d/
|
|
128
136
|
```
|
|
129
137
|
|
|
130
138
|
```ghost
|
|
@@ -161,6 +169,7 @@ mySprite.setStayInScreen(true)
|
|
|
161
169
|
|
|
162
170
|
```
|
|
163
171
|
|
|
172
|
+
|
|
164
173
|
```assetjson
|
|
165
174
|
{
|
|
166
175
|
"README.md": " ",
|
|
@@ -9,17 +9,20 @@ Let's add some enemies for your ship to avoid.
|
|
|
9
9
|

|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## 2. Enemy Rain
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
**Feel like making enemies rain from the sky?**
|
|
15
|
+
👾👾👾
|
|
15
16
|
|
|
16
17
|
Let's add some code that will drop an enemy toward the ship every couple of seconds.
|
|
17
18
|
|
|
18
19
|
---
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
- :circle: Add an
|
|
22
|
+
``||game:on game update every [500] ms||``
|
|
23
|
+
container to the workspace.
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
- :mouse pointer: Change the number value to **2000** [__*ms*__](#millis "milliseconds...aka 1/1000 of a second")
|
|
23
26
|
(or pick **2 second** from the dropdown)
|
|
24
27
|
|
|
25
28
|
|
|
@@ -29,16 +32,15 @@ game.onUpdateInterval(2000, function () {
|
|
|
29
32
|
})
|
|
30
33
|
```
|
|
31
34
|
|
|
32
|
-
##
|
|
35
|
+
## 3. Rename the Variable
|
|
33
36
|
|
|
34
|
-
|
|
35
|
-
``||variables:set [projectile2] to projectile [ ] from side with vx [50] vy [50]||``
|
|
36
|
-
and drag it into the new **on game update** container.
|
|
37
|
+
- :paper plane: Find the
|
|
38
|
+
``||variables:set [projectile2] to projectile [ ] from side with vx [50] vy [50]||``
|
|
39
|
+
block and drag it into the new **on game update** container.
|
|
37
40
|
|
|
38
|
-
|
|
39
|
-
select "Rename variable..."
|
|
41
|
+
- :mouse pointer: Click on the ``||variables:[projectile2]||`` value inside the new block and select "Rename variable..." .
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
- :mouse pointer: Change the variable name to ``||variables:myEnemy||`` so we know these are the baddies.
|
|
42
44
|
|
|
43
45
|
|
|
44
46
|
|
|
@@ -54,14 +56,15 @@ game.onUpdateInterval(2000, function () {
|
|
|
54
56
|
})
|
|
55
57
|
```
|
|
56
58
|
|
|
57
|
-
##
|
|
58
|
-
|
|
59
|
+
## 4. Straight Down
|
|
60
|
+
|
|
61
|
+
**Let's get the enemies moving in the right direction**
|
|
59
62
|
|
|
60
63
|
---
|
|
61
64
|
|
|
62
|
-
|
|
65
|
+
- :paint brush: Click the grey square in the new block and toggle to **My Assets** to grab **Spider**.
|
|
63
66
|
|
|
64
|
-
|
|
67
|
+
- :mouse pointer: Play with the **vx** and **vy** values of **myEnemy** until
|
|
65
68
|
your new sprites are falling straight down the side of the screen.
|
|
66
69
|
|
|
67
70
|
💡 Are the enemies all falling down to the left of the screen? Don't worry, we'll handle that in the next step!
|
|
@@ -76,17 +79,19 @@ game.onUpdateInterval(2000, function () {
|
|
|
76
79
|
|
|
77
80
|
```
|
|
78
81
|
|
|
79
|
-
##
|
|
82
|
+
## 5. So Random
|
|
80
83
|
|
|
81
84
|
Enemies aren't likely to hit the ship if they're off to the side. Let's add an element of surprise using [__*random numbers*__](#randos "numbers appearing seemingly without a predictable pattern") .
|
|
82
85
|
|
|
83
86
|
---
|
|
84
87
|
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
- :paper plane: Snap a
|
|
89
|
+
``||sprites:set [mySprite] [x] to [0]||``
|
|
90
|
+
block into the end of the
|
|
91
|
+
``||game:on game update every [2000] ms||``
|
|
92
|
+
container.
|
|
87
93
|
|
|
88
|
-
|
|
89
|
-
new block to change ``||variables:mySprite||`` to ``||variables:myEnemy||``.
|
|
94
|
+
- :mouse pointer: To make sure we're acting on the right sprites, use the dropdown in the new block to change ``||variables:mySprite||`` to ``||variables:myEnemy||``.
|
|
90
95
|
|
|
91
96
|
```blocks
|
|
92
97
|
game.onUpdateInterval(2000, function () {
|
|
@@ -95,21 +100,24 @@ game.onUpdateInterval(2000, function () {
|
|
|
95
100
|
})
|
|
96
101
|
```
|
|
97
102
|
|
|
98
|
-
##
|
|
103
|
+
## 6. Horizontal
|
|
99
104
|
|
|
100
|
-
|
|
101
|
-
for the enemies using a
|
|
102
|
-
``||Math:pick random [0] to [10]||`` block
|
|
103
|
-
Connect it to replace the **0** in the
|
|
105
|
+
- :calculator: Set a random [__*x*__](#setX "horizontal location")
|
|
106
|
+
for the enemies using a
|
|
107
|
+
``||Math:pick random [0] to [10]||`` block.
|
|
108
|
+
Connect it to replace the **0** in the
|
|
109
|
+
``||sprites:set [myEnemy] [x] to [0]||``
|
|
110
|
+
block.
|
|
104
111
|
|
|
105
|
-
|
|
106
|
-
|
|
112
|
+
- :mouse pointer: Finally, update the minimum argument of the
|
|
113
|
+
``||Math:pick random [0] to [10]||``
|
|
114
|
+
block to **5** and the maximum argument to **155**.
|
|
107
115
|
|
|
108
116
|
---
|
|
109
117
|
|
|
110
|
-
|
|
118
|
+
_💡 The Arcade screen is 160px wide,
|
|
111
119
|
so you could make your enemies fall anywhere between 0 and 160
|
|
112
|
-
and still be able to see a piece of them.
|
|
120
|
+
and still be able to see a piece of them._
|
|
113
121
|
|
|
114
122
|
```blocks
|
|
115
123
|
game.onUpdateInterval(2000, function () {
|
|
@@ -119,18 +127,18 @@ game.onUpdateInterval(2000, function () {
|
|
|
119
127
|
```
|
|
120
128
|
|
|
121
129
|
|
|
122
|
-
##
|
|
130
|
+
## 7. Enemy Kind
|
|
123
131
|
|
|
124
132
|
We now have two different kinds of projectiles. Let's make sure the computer knows they're different by setting this one to an
|
|
125
133
|
"**Enemy**" [__*kind*__](#withClass "a label you give a particular group so you can refer to it later").
|
|
126
134
|
|
|
127
135
|
---
|
|
128
136
|
|
|
129
|
-
|
|
130
|
-
|
|
137
|
+
- :paper plane: Snap a
|
|
138
|
+
``||sprites:set [mySprite] kind to [Player]||``
|
|
139
|
+
block into the bottom of the **on game update** container.
|
|
131
140
|
|
|
132
|
-
|
|
133
|
-
``||sprites:Enemy||`` as the kind.
|
|
141
|
+
- :mouse pointer: Change ``||variables:mySprite||`` to ``||variables:myEnemy||``, then choose ``||sprites:Enemy||`` as the kind.
|
|
134
142
|
|
|
135
143
|
|
|
136
144
|
|
|
@@ -143,25 +151,25 @@ game.onUpdateInterval(2000, function () {
|
|
|
143
151
|
```
|
|
144
152
|
|
|
145
153
|
|
|
146
|
-
##
|
|
154
|
+
## 8. Collision
|
|
147
155
|
|
|
148
|
-
|
|
156
|
+
**Time to create some enemy behavior**
|
|
149
157
|
|
|
150
158
|
To add excitement to the game, let's make something happen when an enemy
|
|
151
159
|
collides with our ship.
|
|
152
160
|
|
|
153
161
|
---
|
|
154
162
|
|
|
155
|
-
|
|
163
|
+
- :paper plane: Drag an
|
|
164
|
+
``||sprites:on [sprite] of kind [Player] overlaps [othersprite] of kind [Player]||``
|
|
156
165
|
container into the workspace.
|
|
157
166
|
|
|
158
|
-
|
|
167
|
+
- :mouse pointer: Change the last value from ``||sprites:Player||`` to ``||sprites:Enemy||``.
|
|
159
168
|
|
|
160
169
|
---
|
|
161
170
|
|
|
162
|
-
|
|
163
|
-
The variable "sprite"
|
|
164
|
-
variable is the specific **Enemy** sprite that our **Player** overlapped with.
|
|
171
|
+
_💡 Don't try to change "sprite" → "mySprite" or "otherSprite" → "myEnemy".
|
|
172
|
+
The variable "sprite" is the **Player** sprite (our Rocket) and the "otherSprite" variable is the specific **Enemy** sprite that our **Player** overlapped with._
|
|
165
173
|
|
|
166
174
|
```blocks
|
|
167
175
|
sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSprite) {
|
|
@@ -169,17 +177,20 @@ sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSp
|
|
|
169
177
|
})
|
|
170
178
|
```
|
|
171
179
|
|
|
172
|
-
##
|
|
180
|
+
## 9. Fewer Lives
|
|
173
181
|
|
|
174
182
|
When the enemy collides with the ship,
|
|
175
183
|
we want it to subtract a life...then disappear.
|
|
176
184
|
|
|
177
185
|
---
|
|
178
186
|
|
|
179
|
-
|
|
180
|
-
|
|
187
|
+
- :id card: Grab the
|
|
188
|
+
``||info:change life by [-1]||``
|
|
189
|
+
block and snap it into the **on player overlaps enemy** container. That removes a life from the player every time it's hit by an enemy!
|
|
181
190
|
|
|
182
|
-
|
|
191
|
+
- :paper plane: Find the
|
|
192
|
+
``||sprites:destroy [mySprite] ⊕||``
|
|
193
|
+
block and snap it below the previous block.
|
|
183
194
|
|
|
184
195
|
```blocks
|
|
185
196
|
let mySprite: Sprite = null
|
|
@@ -189,19 +200,19 @@ sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSp
|
|
|
189
200
|
})
|
|
190
201
|
```
|
|
191
202
|
|
|
192
|
-
##
|
|
203
|
+
## 10. Destroy
|
|
193
204
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
``||variables:mySprite||`` argument in ``||sprites:destroy [mySprite] ⊕||``.
|
|
205
|
+
- :mouse pointer: To tell the **destroy** block that you want it to affect the overlapping enemy, click on the ``||variables:otherSprite||`` value from the top of the **overlaps** container and drag it down to replace the
|
|
206
|
+
``||variables:mySprite||`` value inside
|
|
207
|
+
``||sprites:destroy [mySprite] ➕||``.
|
|
198
208
|
|
|
199
209
|

|
|
200
210
|
|
|
201
211
|
---
|
|
202
212
|
|
|
203
|
-
|
|
204
|
-
|
|
213
|
+
_💡 Click the __➕__ on the
|
|
214
|
+
``||sprites:destroy [otherSprite] ➕||``
|
|
215
|
+
block to get a menu of effects to display upon your enemy's demise!_
|
|
205
216
|
|
|
206
217
|
```blocks
|
|
207
218
|
sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSprite) {
|
|
@@ -210,30 +221,34 @@ sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSp
|
|
|
210
221
|
})
|
|
211
222
|
```
|
|
212
223
|
|
|
213
|
-
##
|
|
224
|
+
## 11. Fire!
|
|
214
225
|
|
|
215
|
-
|
|
226
|
+
**Time to save the world**
|
|
227
|
+
🌍 🌍 🌍
|
|
216
228
|
|
|
217
|
-
Another **overlap** container will help
|
|
229
|
+
Another **overlap** container will help the projectiles
|
|
218
230
|
destroy our enemies on impact.
|
|
219
231
|
|
|
220
232
|
---
|
|
221
233
|
|
|
222
234
|
|
|
223
|
-
|
|
235
|
+
- :paper plane: Drag another
|
|
236
|
+
``||sprites:on [sprite] of kind [Player] overlaps [othersprite] of kind [Player]||``
|
|
224
237
|
container into the workspace.
|
|
225
238
|
|
|
226
|
-
|
|
239
|
+
- :mouse pointer: Change the first kind to ``||sprites:Enemy||`` and the second kind to
|
|
227
240
|
``||sprites:Projectile||``.
|
|
228
241
|
|
|
229
|
-
|
|
242
|
+
- :paper plane: Inside, add two
|
|
243
|
+
``||sprites:destroy [mySprite] ⊕||``
|
|
244
|
+
blocks, then change the arguments
|
|
230
245
|
so that one destroys the enemy (``||variables:sprite||``) and the other
|
|
231
246
|
destroys your projectile (``||variables:otherSprite||``).
|
|
232
247
|
|
|
233
248
|
---
|
|
234
249
|
|
|
235
|
-
|
|
236
|
-
some spectacular effects when your projectile makes contact!
|
|
250
|
+
_💡 Don't forget to hit that __➕__ button on the **destroy** block to get
|
|
251
|
+
some spectacular effects when your projectile makes contact!_
|
|
237
252
|
|
|
238
253
|
```blocks
|
|
239
254
|
sprites.onOverlap(SpriteKind.Enemy, SpriteKind.Projectile, function (sprite, otherSprite) {
|
|
@@ -242,13 +257,15 @@ sprites.onOverlap(SpriteKind.Enemy, SpriteKind.Projectile, function (sprite, oth
|
|
|
242
257
|
})
|
|
243
258
|
```
|
|
244
259
|
|
|
245
|
-
##
|
|
260
|
+
## 12. Add Points
|
|
246
261
|
|
|
247
|
-
|
|
262
|
+
**Finally, let's add a point for each enemy destroyed**
|
|
248
263
|
|
|
249
264
|
---
|
|
250
265
|
|
|
251
|
-
|
|
266
|
+
- :id card: Drag
|
|
267
|
+
``||info:change score by [1]||``
|
|
268
|
+
into **the end** of the **on enemy overlaps projectile** container.
|
|
252
269
|
|
|
253
270
|
```blocks
|
|
254
271
|
sprites.onOverlap(SpriteKind.Enemy, SpriteKind.Projectile, function (sprite, otherSprite) {
|
|
@@ -258,26 +275,26 @@ sprites.onOverlap(SpriteKind.Enemy, SpriteKind.Projectile, function (sprite, oth
|
|
|
258
275
|
})
|
|
259
276
|
```
|
|
260
277
|
|
|
261
|
-
##
|
|
278
|
+
## 13. Finale
|
|
262
279
|
|
|
263
280
|
**Congratulations**
|
|
264
281
|
|
|
265
|
-
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
Now you have a bunch of enemies to combat.
|
|
266
285
|
Don't forget to play with your project in the game screen before you go.
|
|
267
286
|
|
|
268
|
-
Once you're happy, click **Done** to return to the main
|
|
269
|
-
with family and friends!
|
|
287
|
+
Once you're happy, click **Done** to return to the main skillmap where you can carry on to add some drama with an animated ship!
|
|
270
288
|
|
|
271
289
|
|
|
272
290
|
|
|
273
291
|
|
|
274
292
|
|
|
275
293
|
```package
|
|
276
|
-
arcade-background-scroll=github:microsoft/arcade-background-scroll/
|
|
294
|
+
arcade-background-scroll=github:microsoft/arcade-background-scroll#926e12eefffd09d453c7cde73f8d6ebd0e666d9d/
|
|
277
295
|
pxt-status-bar=github:jwunderl/pxt-status-bar
|
|
278
296
|
```
|
|
279
297
|
|
|
280
|
-
|
|
281
298
|
```template
|
|
282
299
|
|
|
283
300
|
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
|