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
|
@@ -13,18 +13,21 @@ ship from breaking down!
|
|
|
13
13
|

|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
##
|
|
17
|
-
The code in the workspace taking up a lot of room!
|
|
16
|
+
## 2. Add a Status Bar
|
|
17
|
+
The code in the workspace is taking up a lot of room!
|
|
18
|
+
😨 😨 😨
|
|
18
19
|
Don't worry, the workspace will expand if you scroll up &
|
|
19
20
|
over (or down & over) to keep building.
|
|
20
21
|
|
|
21
22
|
---
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
You'll find
|
|
25
|
-
|
|
24
|
+
- :battery full: Take a peek into the new ``||statusbars:Status Bars||`` category.
|
|
25
|
+
You'll find
|
|
26
|
+
``||variables:set [statusbar] to create status bar sprite width [20] height [4] kind [Health]||``.
|
|
27
|
+
Drag one to the end of the
|
|
28
|
+
``||loops:on start||`` container.
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
- :mouse pointer: In the **set statusbar** block, click on **Health** to get the dropdown menu, then select **Energy** to create a fuel gauge.
|
|
28
31
|
|
|
29
32
|
|
|
30
33
|
---
|
|
@@ -33,18 +36,21 @@ Drag one to the end of the ``||loops:on start||`` container.
|
|
|
33
36
|
let statusbar = statusbars.create(20, 4, StatusBarKind.Energy)
|
|
34
37
|
```
|
|
35
38
|
|
|
36
|
-
##
|
|
39
|
+
## 3. Link It
|
|
37
40
|
|
|
38
41
|
If we want the status bar to show the details of **mySprite**, we'll need to link the two together.
|
|
39
42
|
|
|
40
43
|
---
|
|
41
44
|
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
- :battery full: Drag
|
|
46
|
+
``||statusbars:attach [statusbar] to [mySprite] ➕||``
|
|
47
|
+
into **the end** of the
|
|
48
|
+
``||loops:on start||`` container.
|
|
44
49
|
|
|
45
|
-
|
|
46
|
-
to change the position of the status bar in relation to **mySprite**.
|
|
47
|
-
|
|
50
|
+
- :mouse pointer: Click ➕ on the new block to reveal options
|
|
51
|
+
to change the position of the status bar in relation to **mySprite**.
|
|
52
|
+
|
|
53
|
+
_💡 Can you figure out how to get the bar to show up *below* your ship?_
|
|
48
54
|
|
|
49
55
|
|
|
50
56
|
```block
|
|
@@ -53,26 +59,29 @@ let statusbar = statusbars.create(20, 4, StatusBarKind.Energy)
|
|
|
53
59
|
statusbar.attachToSprite(mySprite, -30, 0)
|
|
54
60
|
```
|
|
55
61
|
|
|
56
|
-
##
|
|
62
|
+
## 4. Running Out
|
|
57
63
|
|
|
58
|
-
|
|
64
|
+
**The longer you're in the air, the more fuel you use**
|
|
59
65
|
|
|
60
66
|
Here's how to make the fuel go down as time passes.
|
|
61
67
|
|
|
62
68
|
---
|
|
63
69
|
|
|
64
|
-
|
|
70
|
+
- :circle: Drag an
|
|
71
|
+
``||game:on game update every [500] ms||``
|
|
72
|
+
container into an empty area of the
|
|
65
73
|
workspace. Adjust the time argument to **300 ms**.
|
|
66
74
|
|
|
67
|
-
|
|
75
|
+
- :battery full: Drop
|
|
76
|
+
``||statusbars:change [statusbar] [value] by [0]||``
|
|
68
77
|
into the empty **game update** container.
|
|
69
78
|
|
|
70
|
-
|
|
79
|
+
- :mouse pointer: Change the amount the status bar changes from **0** to **-1**.
|
|
71
80
|
|
|
72
81
|
---
|
|
73
82
|
|
|
74
|
-
|
|
75
|
-
gameplay, you can come back and adjust these blocks.
|
|
83
|
+
_💡 Remember this step later. If the fuel runs out too fast in
|
|
84
|
+
gameplay, you can come back and adjust these blocks._
|
|
76
85
|
|
|
77
86
|
|
|
78
87
|
```blocks
|
|
@@ -82,24 +91,24 @@ game.onUpdateInterval(300, function () {
|
|
|
82
91
|
})
|
|
83
92
|
```
|
|
84
93
|
|
|
85
|
-
##
|
|
94
|
+
## 5. Refuel
|
|
86
95
|
|
|
87
96
|
**⛽ Time to refuel ⛽**
|
|
88
97
|
|
|
89
|
-
The code for adding fuel sprites to your game is a lot like the code for making enemies.
|
|
90
|
-
For a refresher on how things work, find the **myEnemy** blocks in the
|
|
98
|
+
The code for adding fuel sprites to your game is a lot like the code for making enemies. For a refresher on how things work, find the **myEnemy** blocks in the
|
|
91
99
|
workspace and use them as a guide.
|
|
92
100
|
|
|
93
101
|
---
|
|
94
102
|
|
|
95
|
-
|
|
96
|
-
|
|
103
|
+
- :circle: Drag a _new_
|
|
104
|
+
``||game:on game update every [500] ms||``
|
|
105
|
+
container into the workspace and change the interval to **5 seconds (5000 ms)**.
|
|
97
106
|
|
|
98
|
-
|
|
99
|
-
``||variables:set [projectile2] to projectile [ ] from side with vx [50] vy [50]||``
|
|
107
|
+
- :paper plane: Snap a new
|
|
108
|
+
``||variables:set [projectile2] to projectile [ ] from side with vx [50] vy [50]||``
|
|
100
109
|
block inside the newest **on game update** container.
|
|
101
110
|
|
|
102
|
-
|
|
111
|
+
- :mouse pointer: Click ``||variables:[projectile2]||`` and rename the sprite ``||variables:[myFuel]||``.
|
|
103
112
|
|
|
104
113
|
|
|
105
114
|
```blocks
|
|
@@ -113,12 +122,11 @@ game.onUpdateInterval(5000, function () {
|
|
|
113
122
|
})
|
|
114
123
|
```
|
|
115
124
|
|
|
116
|
-
##
|
|
125
|
+
## 6. Set the Sprite
|
|
117
126
|
|
|
118
|
-
|
|
127
|
+
- :paint brush: Click on the grey square and toggle to **My Assets** to choose the **Fuel** sprite.
|
|
119
128
|
|
|
120
|
-
|
|
121
|
-
straight down at a decent speed.
|
|
129
|
+
- :mouse pointer: Play with the **vx** and **vy** arguments of the fuel until it's falling straight down at a decent speed.
|
|
122
130
|
|
|
123
131
|
|
|
124
132
|
|
|
@@ -128,18 +136,20 @@ game.onUpdateInterval(5000, function () {
|
|
|
128
136
|
})
|
|
129
137
|
```
|
|
130
138
|
|
|
131
|
-
##
|
|
139
|
+
## 7. Fuel Drop
|
|
132
140
|
|
|
133
141
|
Just like with the enemies, we'll want the fuel to drop from a random position
|
|
134
142
|
across the top of the screen.
|
|
135
143
|
|
|
136
144
|
---
|
|
137
145
|
|
|
138
|
-
|
|
139
|
-
|
|
146
|
+
- :paper plane: Connect a
|
|
147
|
+
``||sprites:set [mySprite] [x] to [0]||``
|
|
148
|
+
block at **the bottom** of the
|
|
149
|
+
``||game:on game update every [5000] ms||``
|
|
150
|
+
container.
|
|
140
151
|
|
|
141
|
-
|
|
142
|
-
new block to change ``||variables:mySprite||`` to ``||variables:myFuel||``.
|
|
152
|
+
- :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:myFuel||``.
|
|
143
153
|
|
|
144
154
|
|
|
145
155
|
```blocks
|
|
@@ -150,15 +160,18 @@ game.onUpdateInterval(5000, function () {
|
|
|
150
160
|
```
|
|
151
161
|
|
|
152
162
|
|
|
153
|
-
##
|
|
163
|
+
## 8. Random Location
|
|
154
164
|
|
|
155
|
-
|
|
156
|
-
for the fuel, grab a
|
|
157
|
-
``||Math:pick random [0] to [10]||``
|
|
158
|
-
and connect it to replace the **0** argument in the
|
|
159
|
-
``||sprites:set [mySprite] [x] to [0]||``
|
|
165
|
+
- :calculator: To set a random [__*x*__](#setX "horizontal location")
|
|
166
|
+
for the fuel, grab a
|
|
167
|
+
``||Math:pick random [0] to [10]||``
|
|
168
|
+
block and connect it to replace the **0** argument in the
|
|
169
|
+
``||sprites:set [mySprite] [x] to [0]||``
|
|
170
|
+
block.
|
|
160
171
|
|
|
161
|
-
|
|
172
|
+
- :mouse pointer: Update the minimum argument of the
|
|
173
|
+
``||Math:pick random [0] to [10]||``
|
|
174
|
+
block to **5** and the
|
|
162
175
|
maximum argument to **155**.
|
|
163
176
|
|
|
164
177
|
---
|
|
@@ -172,18 +185,19 @@ game.onUpdateInterval(5000, function () {
|
|
|
172
185
|
```
|
|
173
186
|
|
|
174
187
|
|
|
175
|
-
##
|
|
188
|
+
## 9. Gas Kind
|
|
176
189
|
|
|
177
190
|
Now we need to create a new **kind** of sprite for our **Fuel**!
|
|
178
191
|
|
|
179
192
|
---
|
|
180
193
|
|
|
181
|
-
|
|
182
|
-
|
|
194
|
+
- :paper plane: Snap a
|
|
195
|
+
``||sprites:set [mySprite] kind to [Player]||``
|
|
196
|
+
block into the bottom of the newest **on game update** container.
|
|
183
197
|
|
|
184
|
-
|
|
198
|
+
- :mouse pointer: Change ``||variables:mySprite||`` to ``||variables:myFuel||``.
|
|
185
199
|
|
|
186
|
-
|
|
200
|
+
- :mouse pointer: Click ``||sprites:Player||`` to get the dropdown menu, then choose
|
|
187
201
|
``||sprites:Add a new kind...||`` and create the type **Gas**.
|
|
188
202
|
|
|
189
203
|
|
|
@@ -200,15 +214,16 @@ game.onUpdateInterval(5000, function () {
|
|
|
200
214
|
```
|
|
201
215
|
|
|
202
216
|
|
|
203
|
-
##
|
|
217
|
+
## 10. Getting Gas
|
|
204
218
|
When your ship overlaps fuel, you'll want the gas to disappear as the tank refills.
|
|
205
219
|
|
|
206
220
|
---
|
|
207
221
|
|
|
208
|
-
|
|
222
|
+
- :paper plane: Drag an
|
|
223
|
+
``||sprites:on [sprite] of kind [Player] overlaps [othersprite] of kind [Player]||``
|
|
209
224
|
container into the workspace.
|
|
210
225
|
|
|
211
|
-
|
|
226
|
+
- :mouse pointer: Change the last argument from ``||sprites:Player||`` to ``||sprites:Gas||``.
|
|
212
227
|
|
|
213
228
|
|
|
214
229
|
|
|
@@ -222,14 +237,16 @@ sprites.onOverlap(SpriteKind.Player, SpriteKind.Gas, function (sprite, otherSpri
|
|
|
222
237
|
})
|
|
223
238
|
```
|
|
224
239
|
|
|
225
|
-
##
|
|
240
|
+
## 11. Refill
|
|
226
241
|
|
|
227
|
-
|
|
228
|
-
|
|
242
|
+
- :battery full: To refill the status bar after grabbing fuel, snag a
|
|
243
|
+
``||statusbars:set [statusbar] [value] to [0]||``
|
|
244
|
+
block and snap it in to your newest **overlaps** container.
|
|
229
245
|
|
|
230
|
-
|
|
246
|
+
- :mouse pointer: Change the value from **0** to **100**.
|
|
231
247
|
|
|
232
|
-
|
|
248
|
+
- :paper plane: Finally, make sure the used fuel disappears by snapping a
|
|
249
|
+
``||sprites:destroy [mySprite] ➕||`` block
|
|
233
250
|
into the bottom of the same **overlaps** container and replacing
|
|
234
251
|
``||variables:mySprite||`` with ``||variables:otherSprite||``
|
|
235
252
|
|
|
@@ -248,20 +265,20 @@ sprites.onOverlap(SpriteKind.Player, SpriteKind.Gas, function (sprite, otherSpri
|
|
|
248
265
|
})
|
|
249
266
|
```
|
|
250
267
|
|
|
251
|
-
##
|
|
252
|
-
|
|
268
|
+
## 12. Lost in Space
|
|
269
|
+
**If you run out of fuel, you'll be marooned in space!**
|
|
253
270
|
|
|
254
271
|
The threat is real.
|
|
255
272
|
|
|
256
273
|
---
|
|
257
274
|
|
|
258
|
-
|
|
259
|
-
``||statusbars:on status bar kind [Health] zero [status]||``
|
|
275
|
+
- :battery full: To add consequences for an empty status bar, drag an
|
|
276
|
+
``||statusbars:on status bar kind [Health] zero [status]||``
|
|
260
277
|
container into the workspace.
|
|
261
278
|
|
|
262
|
-
|
|
279
|
+
- :mouse pointer: Change the status bar kind to **Energy**.
|
|
263
280
|
|
|
264
|
-
|
|
281
|
+
- :circle: Snap a ``||game:game over <LOSE>||`` block inside as the ultimate fate.
|
|
265
282
|
|
|
266
283
|
|
|
267
284
|
```blocks
|
|
@@ -275,7 +292,9 @@ statusbars.onZero(StatusBarKind.Energy, function (status) {
|
|
|
275
292
|
|
|
276
293
|
**And that's it!**
|
|
277
294
|
|
|
278
|
-
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
Click **Done** to return to the main skillmap to move on and find out how to add multiple levels to your game!
|
|
279
298
|
|
|
280
299
|
|
|
281
300
|
|
|
@@ -283,11 +302,10 @@ Click **Done** to return to the main page where you can add this game to your ga
|
|
|
283
302
|
|
|
284
303
|
|
|
285
304
|
```package
|
|
286
|
-
arcade-background-scroll=github:microsoft/arcade-background-scroll/
|
|
305
|
+
arcade-background-scroll=github:microsoft/arcade-background-scroll#926e12eefffd09d453c7cde73f8d6ebd0e666d9d/
|
|
287
306
|
pxt-status-bar=github:jwunderl/pxt-status-bar
|
|
288
307
|
```
|
|
289
308
|
|
|
290
|
-
|
|
291
309
|
```template
|
|
292
310
|
|
|
293
311
|
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
@@ -303,6 +321,7 @@ sprites.onOverlap(SpriteKind.Projectile, SpriteKind.Enemy, function (sprite, oth
|
|
|
303
321
|
sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSprite) {
|
|
304
322
|
info.changeLifeBy(-1)
|
|
305
323
|
otherSprite.destroy(effects.disintegrate, 200)
|
|
324
|
+
scene.cameraShake(4, 500)
|
|
306
325
|
})
|
|
307
326
|
let myEnemy: Sprite = null
|
|
308
327
|
let projectile: Sprite = null
|
|
@@ -312,10 +331,22 @@ scroller.scrollBackgroundWithSpeed(0, 10)
|
|
|
312
331
|
mySprite = sprites.create(assets.image`Rocket`, SpriteKind.Player)
|
|
313
332
|
controller.moveSprite(mySprite)
|
|
314
333
|
mySprite.setStayInScreen(true)
|
|
334
|
+
animation.runImageAnimation(
|
|
335
|
+
mySprite,
|
|
336
|
+
assets.animation`Flying Rocket`,
|
|
337
|
+
100,
|
|
338
|
+
true
|
|
339
|
+
)
|
|
315
340
|
game.onUpdateInterval(2000, function () {
|
|
316
341
|
myEnemy = sprites.createProjectileFromSide(assets.image`Spider`, 0, 50)
|
|
317
342
|
myEnemy.x = randint(5, 155)
|
|
318
343
|
myEnemy.setKind(SpriteKind.Enemy)
|
|
344
|
+
animation.runImageAnimation(
|
|
345
|
+
myEnemy,
|
|
346
|
+
assets.animation`Flying Spider`,
|
|
347
|
+
100,
|
|
348
|
+
true
|
|
349
|
+
)
|
|
319
350
|
})
|
|
320
351
|
```
|
|
321
352
|
|
|
@@ -7,23 +7,25 @@ Let's make this game more impactful by adding effects that bring the action to l
|
|
|
7
7
|

|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## 2. Play Your Game
|
|
11
11
|
|
|
12
12
|
The code for the beginning of your Space Explorer game is in the workspace.
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Play your game on the game screen to make sure you can connect each action to the proper block of code.
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## 3. Shake the Camera
|
|
20
20
|
|
|
21
21
|
Let's add some drama by shaking the camera when you run into an enemy ship.
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
- :tree: Grab
|
|
26
|
+
``||scene:camera shake by [4] pixels for [500] ms||``
|
|
27
|
+
and snap it in to **the bottom** of the
|
|
28
|
+
``||sprites:on [sprite] of kind [Player] overlaps [otherSPrite] of kind [Enemy]||``
|
|
27
29
|
container.
|
|
28
30
|
|
|
29
31
|
|
|
@@ -36,18 +38,19 @@ sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSp
|
|
|
36
38
|
})
|
|
37
39
|
```
|
|
38
40
|
|
|
39
|
-
##
|
|
41
|
+
## 4. Animate the Ship
|
|
40
42
|
|
|
41
43
|
**Add excitement by animating the main ship!**
|
|
42
44
|
|
|
43
45
|
---
|
|
44
46
|
|
|
45
|
-
|
|
47
|
+
- :angle down: In the toolbox, click **Advanced** to reveal the
|
|
46
48
|
``||animation:Animation||`` category.
|
|
47
49
|
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
- :sync: Grab the ``||animation:animate [mySprite]||``
|
|
52
|
+
block and snap it into **the end** of the
|
|
53
|
+
``||loops:on start||`` container.
|
|
51
54
|
|
|
52
55
|
|
|
53
56
|
```blocks
|
|
@@ -83,11 +86,10 @@ false
|
|
|
83
86
|
)
|
|
84
87
|
```
|
|
85
88
|
|
|
86
|
-
##
|
|
87
|
-
|
|
88
|
-
and choose the **Flying Rocket** animation. Click **Done** when you are ready.
|
|
89
|
+
## 5. Choose Your Animation
|
|
90
|
+
- :paint brush: To select your animation frames, click the empty grey square then toggle to **My Assets** and choose the **Flying Rocket** animation.
|
|
89
91
|
|
|
90
|
-
|
|
92
|
+
- :mouse pointer: Keep the animation playing throughout the game by toggling the **loop** selector to **`<ON>`**.
|
|
91
93
|
|
|
92
94
|
```blocks
|
|
93
95
|
|
|
@@ -106,20 +108,23 @@ true
|
|
|
106
108
|
)
|
|
107
109
|
```
|
|
108
110
|
|
|
109
|
-
##
|
|
111
|
+
## 6. Try It Out
|
|
110
112
|
|
|
111
|
-
**
|
|
113
|
+
**Play your game and see how much more exciting it looks!**
|
|
112
114
|
|
|
113
115
|
|
|
114
116
|
|
|
115
|
-
##
|
|
117
|
+
## 7. Animated Enemies
|
|
116
118
|
|
|
117
119
|
**Why stop there when you can also animate the enemy???**
|
|
118
120
|
|
|
119
121
|
---
|
|
120
122
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
+
- :sync: Grab another
|
|
124
|
+
``||animation:animate [mySprite]||``
|
|
125
|
+
block and snap it into **the end** of the
|
|
126
|
+
``||game:on game update every [2000] ms||``
|
|
127
|
+
container.
|
|
123
128
|
|
|
124
129
|
|
|
125
130
|
```blocks
|
|
@@ -156,13 +161,15 @@ false
|
|
|
156
161
|
|
|
157
162
|
## Step 8
|
|
158
163
|
|
|
159
|
-
|
|
160
|
-
|
|
164
|
+
- :mouse pointer: To make sure we're animating the correct sprite, replace
|
|
165
|
+
``||variables:mySprite||`` with ``||variables:myEnemy||``
|
|
166
|
+
using the dropdown in the
|
|
167
|
+
``||animation:animate [mySprite]||`` block.
|
|
161
168
|
|
|
162
|
-
|
|
169
|
+
- :paint brush: Click the empty grey square and toggle to **My Assets**
|
|
163
170
|
and choose the **Flying Spider** animation, then click **Done**.
|
|
164
171
|
|
|
165
|
-
|
|
172
|
+
- :mouse pointer: Toggle the **loop** selector to **`<ON>`**.
|
|
166
173
|
|
|
167
174
|
```blocks
|
|
168
175
|
game.onUpdateInterval(2000, function () {
|
|
@@ -184,14 +191,16 @@ game.onUpdateInterval(2000, function () {
|
|
|
184
191
|
|
|
185
192
|
**There you have it!**
|
|
186
193
|
|
|
194
|
+
---
|
|
195
|
+
|
|
187
196
|
Take a look...your game feels so professional now!
|
|
188
197
|
|
|
189
|
-
When you're ready, click **Done** to return to the skillmap
|
|
190
|
-
to your gallery and share it with friends.
|
|
198
|
+
When you're ready, click **Done** to return to the skillmap so you can move to the next level where we'll show you how to refuel your ship!
|
|
191
199
|
|
|
192
200
|
|
|
193
201
|
```package
|
|
194
|
-
arcade-background-scroll=github:microsoft/arcade-background-scroll/
|
|
202
|
+
arcade-background-scroll=github:microsoft/arcade-background-scroll#926e12eefffd09d453c7cde73f8d6ebd0e666d9d/
|
|
203
|
+
pxt-status-bar=github:jwunderl/pxt-status-bar
|
|
195
204
|
```
|
|
196
205
|
|
|
197
206
|
|