pxt-arcade 1.11.21 → 1.11.22
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 +5 -0
- package/built/common-sim.js +28 -4
- package/built/sim.js +35 -6
- package/built/target.js +628 -315
- package/built/target.json +628 -315
- package/built/targetlight.json +5 -5
- package/docs/static/skillmap/assets/gallery.png +0 -0
- package/docs/static/skillmap/backgrounds/dino-comp.png +0 -0
- package/docs/static/skillmap/backgrounds/story-comp.png +0 -0
- package/docs/test/skillmap/balloon/balloon4.md +73 -50
- package/docs/test/skillmap/dino/collectort1.md +334 -0
- package/docs/test/skillmap/dino/collectort2.md +272 -0
- package/docs/test/skillmap/dino/collectort3.md +304 -0
- package/docs/test/skillmap/dino/collectort4.md +330 -0
- package/docs/test/skillmap/dino/collectort4old.md +433 -0
- package/docs/test/skillmap/dino/collectort5.md +499 -0
- package/docs/test/skillmap/dino/scroller.ts +54 -0
- package/docs/test/skillmap/mole/mole1.md +3 -3
- package/docs/test/skillmap/mole/mole2.md +8 -8
- package/docs/test/skillmap/mole/mole3.md +12 -12
- package/docs/test/skillmap/mole/mole4.md +5 -5
- package/docs/test/skillmap/star/star1.md +270 -0
- package/docs/test/skillmap/star/star2.md +262 -0
- package/docs/test/skillmap/star/star3.md +186 -0
- package/docs/test/skillmap/star/star4.md +162 -0
- package/docs/test/skillmap/star.md +86 -0
- package/docs/test/skillmap/story/joke-examples.md +41 -0
- package/docs/test/skillmap/story/story1.md +275 -0
- package/docs/test/skillmap/story/story2.md +289 -0
- package/docs/test/skillmap/story/story3.md +626 -0
- package/docs/test/skillmap/story/story4.md +1774 -0
- package/docs/test/skillmap/story.md +90 -0
- package/docs/test/tutorials/wakanda.md +417 -0
- package/package.json +4 -4
- package/targetconfig.json +2 -1
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
# Greeting Card
|
|
2
|
+
### @explicitHints true
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## {Intro @showdialog}
|
|
6
|
+
|
|
7
|
+
Are you ready to make greeting cards for your friends and family?
|
|
8
|
+
|
|
9
|
+
Follow these quick steps and you'll have one in no time!
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## {Step 2}
|
|
16
|
+
|
|
17
|
+
**Let's make a card to share!**
|
|
18
|
+
🎨 🎨 🎨
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
- :tree: From the ``||scene:Scene||`` category in the toolbox,
|
|
23
|
+
grab
|
|
24
|
+
|
|
25
|
+
```block
|
|
26
|
+
scene.setBackgroundImage(img`.`)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
and drag it into the ``||loops(noclick):on start||`` container that's already in the workspace.
|
|
30
|
+
|
|
31
|
+
~hint Click here to see how 🕵🏽
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+

|
|
36
|
+
hint~
|
|
37
|
+
|
|
38
|
+
- :mouse pointer: Click **Next** to move on to the next step.
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
#### ~ tutorialhint
|
|
44
|
+
|
|
45
|
+
```blocks
|
|
46
|
+
//@highlight
|
|
47
|
+
scene.setBackgroundImage(img`.`)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
## {Step 3}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
- :paint brush: Click the empty grey square inside the block to open the **image editor**. <br/><br/>
|
|
56
|
+
You can draw your own background or choose one from the **Gallery**.
|
|
57
|
+

|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
~hint Click here to see how 🕵🏽
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+

|
|
65
|
+
hint~
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
#### ~ tutorialhint
|
|
69
|
+
|
|
70
|
+
```blocks
|
|
71
|
+
//@highlight
|
|
72
|
+
scene.setBackgroundImage(storySprites.halloween)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## {Step 4}
|
|
80
|
+
|
|
81
|
+
**Look at your card.**
|
|
82
|
+
|
|
83
|
+
- :binoculars: Take a look at the game window. Do you see the background you chose?
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
## {Step 5}
|
|
89
|
+
|
|
90
|
+
**Add a heartfelt greeting**
|
|
91
|
+
💛 💛 💛
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
- :ticket: From the ``||carnival:Carnival||`` category, drag
|
|
96
|
+
|
|
97
|
+
```block
|
|
98
|
+
carnival.addLabelTo("You Are Awesome", carnival.Areas.Top)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
into **the end** of the ``||loops(noclick):on start||`` container that's already in the workspace.
|
|
102
|
+
|
|
103
|
+
- :mouse pointer: Change the message to whatever you would like.
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
~hint Click here to see how 🕵🏽
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+

|
|
111
|
+
hint~
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
#### ~ tutorialhint
|
|
116
|
+
|
|
117
|
+
```blocks
|
|
118
|
+
scene.setBackgroundImage(storySprites.halloween)
|
|
119
|
+
//@highlight
|
|
120
|
+
carnival.addLabelTo("You Are Awesome", carnival.Areas.Top)
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
## {Step 6}
|
|
128
|
+
|
|
129
|
+
**Time for a celebration**
|
|
130
|
+
🎉🎉🎉
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
- :tree: Add some pizzazz from the ``||scene:Scene||`` category by grabbing a
|
|
135
|
+
|
|
136
|
+
```block
|
|
137
|
+
effects.confetti.startScreenEffect()
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
into **the end** of the ``||loops(noclick):on start||`` container that's already in the workspace.
|
|
141
|
+
|
|
142
|
+
- :mouse pointer: Change the effect to whatever you would like.
|
|
143
|
+
|
|
144
|
+
~hint Click here to see how 🕵🏽
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+

|
|
149
|
+
hint~
|
|
150
|
+
|
|
151
|
+
#### ~ tutorialhint
|
|
152
|
+
|
|
153
|
+
```blocks
|
|
154
|
+
scene.setBackgroundImage(storySprites.halloween)
|
|
155
|
+
carnival.addLabelTo("You Are Awesome", carnival.Areas.Top)
|
|
156
|
+
//@highlight
|
|
157
|
+
effects.confetti.startScreenEffect()
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
## {Step 7}
|
|
165
|
+
|
|
166
|
+
**Look at your creation!**
|
|
167
|
+
|
|
168
|
+
- :binoculars: Take a look at the game window. Does the card look the way you want it to? <br/><br/>
|
|
169
|
+
Feel free to make edits until you are happy with it.
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
## {Step 8}
|
|
176
|
+
|
|
177
|
+
**Let's add a personal note**
|
|
178
|
+
🎵 🎵 🎵
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
- :headphones: From the ``||music:Music||`` category, grab
|
|
183
|
+
|
|
184
|
+
```block
|
|
185
|
+
music.startSong(``, false)
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
into **the end** of the ``||loops(noclick):on start||`` container that's already in the workspace.
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
- :mouse pointer: In the new block, **click the empty rectangle** to open the music editor.<br/><br/>
|
|
192
|
+
You can write your own song or switch to **My Assets** to pick one
|
|
193
|
+
that we've written for you.
|
|
194
|
+
|
|
195
|
+
~hint Click here to see how 🕵🏽
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+

|
|
200
|
+
hint~
|
|
201
|
+
|
|
202
|
+
#### ~ tutorialhint
|
|
203
|
+
|
|
204
|
+
```blocks
|
|
205
|
+
scene.setBackgroundImage(storySprites.halloween)
|
|
206
|
+
effects.confetti.startScreenEffect()
|
|
207
|
+
music.startSong(assets.song`birthday`, false)
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
## {Step 9}
|
|
214
|
+
|
|
215
|
+
**Celebrate your work!**
|
|
216
|
+
|
|
217
|
+
- :binoculars: Take a look at your finished card in the game window.<br/><br/>
|
|
218
|
+
Feel free to go back and make changes until you are happy with it.
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
## {Finish}
|
|
223
|
+
|
|
224
|
+
**Congratulations, you've finished your greeting card! **
|
|
225
|
+
🥳 🥳 🥳
|
|
226
|
+
|
|
227
|
+
Click **Done** to return to the main skillmap page where you can keep going to make an even more detailed card.
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
```blockconfig.global
|
|
231
|
+
carnival.addLabelTo("You Are Awesome", carnival.Areas.Top)
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
```package
|
|
237
|
+
carnival=github:microsoft/arcade-tutorial-extensions/carnival/
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
```ghost
|
|
242
|
+
scene.setBackgroundColor(0)
|
|
243
|
+
scene.setBackgroundImage(img`
|
|
244
|
+
.
|
|
245
|
+
`)
|
|
246
|
+
effects.confetti.startScreenEffect()
|
|
247
|
+
music.setVolume(20)
|
|
248
|
+
music.playMelody("- - - - - - - - ", 120)
|
|
249
|
+
let mySprite = sprites.create(img`
|
|
250
|
+
.
|
|
251
|
+
`, SpriteKind.Player)
|
|
252
|
+
mySprite.setPosition(0, 0)
|
|
253
|
+
forever(function () {
|
|
254
|
+
for (let index = 0; index < 4; index++) {
|
|
255
|
+
|
|
256
|
+
}
|
|
257
|
+
})
|
|
258
|
+
carnival.addLabelTo("You Are Awesome", carnival.Areas.Bottom)
|
|
259
|
+
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
```assetjson
|
|
264
|
+
|
|
265
|
+
{
|
|
266
|
+
"README.md": " ",
|
|
267
|
+
"assets.json": "",
|
|
268
|
+
"images.g.jres": "{\n \"song2\": {\n \"data\": \"0078000408060107001c00020a006400f401640000040000000000000000000000000000000000a80000000200012504000600012508000c0001270e001000012514001800012a18001e00012920002200012524002600012528002c0001272e003000012534003800012c38003e00012a40004200012544004600012548004c0001314c005000012e50005200012a52005400012a54005600012956005800012958005a0001275a006200012762006600013068006c0001306e007400012e76007c00012a7e008000012c82008400012a\",\n \"mimeType\": \"application/mkcd-song\",\n \"displayName\": \"birthday\"\n },\n \"song1\": {\n \"data\": \"0078000408020202001c00010a006400f40164000004000000000000000000000000000500000077000000040002423c0400080002413a08000c00023f380c001000023d3610001400023c3514001800023d3618001c00023f381c002000023c3522002400023d3624002600023f382600280002413a28002a00023d362a002e00023f3830003200023d3632003400023c3536003800023a333a004000023c3507001c00020a006400f401640000040000000000000000000000000000000000660000000200013004000600012e08000a00012c0c000e00012a10001200012914001600012a18001a00012c1c001e00012922002400012a24002600012c26002800012e28002a00012a2a002c00012c30003200012a3200340001293600380001273a003c000129\",\n \"mimeType\": \"application/mkcd-song\",\n \"displayName\": \"Noel Halls\"\n },\n \"*\": {\n \"mimeType\": \"image/x-mkcd-f4\",\n \"dataEncoding\": \"base64\",\n \"namespace\": \"myImages\"\n }\n}",
|
|
269
|
+
"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\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 helpers._registerFactory(\"song\", function(name: string) {\n switch(helpers.stringTrim(name)) {\n case \"song2\":\n case \"birthday\":return hex`0078000408060107001c00020a006400f401640000040000000000000000000000000000000000a80000000200012504000600012508000c0001270e001000012514001800012a18001e00012920002200012524002600012528002c0001272e003000012534003800012c38003e00012a40004200012544004600012548004c0001314c005000012e50005200012a52005400012a54005600012956005800012958005a0001275a006200012762006600013068006c0001306e007400012e76007c00012a7e008000012c82008400012a`;\n case \"song1\":\n case \"Noel Halls\":return hex`0078000408020202001c00010a006400f40164000004000000000000000000000000000500000077000000040002423c0400080002413a08000c00023f380c001000023d3610001400023c3514001800023d3618001c00023f381c002000023c3522002400023d3624002600023f382600280002413a28002a00023d362a002e00023f3830003200023d3632003400023c3536003800023a333a004000023c3507001c00020a006400f401640000040000000000000000000000000000000000660000000200013004000600012e08000a00012c0c000e00012a10001200012914001600012a18001a00012c1c001e00012922002400012a24002600012c26002800012e28002a00012a2a002c00012c30003200012a3200340001293600380001273a003c000129`;\n }\n return null;\n })\n\n}\n// Auto-generated code. Do not edit.\n",
|
|
270
|
+
"main.blocks": "<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"pxt-on-start\" x=\"0\" y=\"0\"></block></xml>",
|
|
271
|
+
"main.ts": "\n",
|
|
272
|
+
"pxt.json": "{\n \"name\": \"Untitled - Copy - Copy - Copy\",\n \"description\": \"\",\n \"dependencies\": {\n \"device\": \"*\",\n \"carnival\": \"github:microsoft/arcade-carnival#v0.0.3\"\n },\n \"files\": [\n \"main.blocks\",\n \"main.ts\",\n \"README.md\",\n \"assets.json\",\n \"images.g.jres\",\n \"images.g.ts\"\n ],\n \"targetVersions\": {\n \"branch\": \"v1.11.21\",\n \"tag\": \"v1.11.21\",\n \"commits\": \"https://github.com/microsoft/pxt-arcade/commits/5fb4210ecb70e5d405aa1a5701b4408b5bfe9094\",\n \"target\": \"1.11.21\",\n \"pxt\": \"8.4.15\"\n },\n \"preferredEditor\": \"blocksprj\"\n}\n"
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
```
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
# Bigger Greeting
|
|
2
|
+
### @explicitHints true
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## {Introduction @showdialog}
|
|
6
|
+
|
|
7
|
+
You've created a card, now let's make it extra special!
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## {Step 2}
|
|
13
|
+
|
|
14
|
+
The code for a simple card is already in the workspace.
|
|
15
|
+
⭐⭐⭐
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
- :mouse pointer: You can keep adding to this card or change it to be something completely different.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
💡 **Tip:** _If your code isn't working and you can't figure out why, click "Replace my code" to replace the blocks in your workspace with new starter code._
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
#### ~ tutorialhint
|
|
27
|
+
```blocks
|
|
28
|
+
scene.setBackgroundImage(storySprites.world)
|
|
29
|
+
effects.confetti.startScreenEffect()
|
|
30
|
+
music.startSong(assets.song`birthday`, false)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
## {Step 3}
|
|
36
|
+
|
|
37
|
+
Try adding text that
|
|
38
|
+
shows up when the **A button** is pressed.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
- :game: From the ``||controller: Controller||`` category, drag
|
|
43
|
+
|
|
44
|
+
```blocks
|
|
45
|
+
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
46
|
+
game.showLongText("Happy Earth Day", DialogLayout.Bottom)
|
|
47
|
+
})
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
into **an empty area** of the workspace.
|
|
51
|
+
|
|
52
|
+
- :mouse pointer: Change the message to make sense for your card.
|
|
53
|
+
|
|
54
|
+
~hint Click here to see how 🕵🏽
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+

|
|
59
|
+
hint~
|
|
60
|
+
|
|
61
|
+
#### ~ tutorialhint
|
|
62
|
+
``` blocks
|
|
63
|
+
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
64
|
+
game.showLongText("Happy Earth Day", DialogLayout.Bottom)
|
|
65
|
+
})
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
## {Step 4}
|
|
72
|
+
|
|
73
|
+
**Give it a try.**
|
|
74
|
+
|
|
75
|
+
- :binoculars: Take a look at the game window and press the **A button** (or space bar) to see your text.
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## {Step 5}
|
|
82
|
+
|
|
83
|
+
**What a nice surprise**
|
|
84
|
+
|
|
85
|
+
Add a second message to show you care.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
- :mouse pointer: From ``||game:Game||`` grab
|
|
90
|
+
|
|
91
|
+
```block
|
|
92
|
+
game.showLongText("To the greatest Earth I know", DialogLayout.Bottom)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
and snap it into **the bottom** of the<br/>
|
|
96
|
+
``||controller(noclick):on [A] button [pressed]||``<br/>
|
|
97
|
+
container.
|
|
98
|
+
|
|
99
|
+
- :mouse pointer: Change this message to make sense with the rest of your project.
|
|
100
|
+
|
|
101
|
+
~hint Click here to see how 🕵🏽
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+

|
|
106
|
+
hint~
|
|
107
|
+
|
|
108
|
+
#### ~ tutorialhint
|
|
109
|
+
``` blocks
|
|
110
|
+
|
|
111
|
+
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
112
|
+
game.showLongText("Happy Earth Day", DialogLayout.Bottom)
|
|
113
|
+
game.showLongText("To the greatest Earth I know", DialogLayout.Bottom)
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
## {Step 6}
|
|
120
|
+
|
|
121
|
+
**🎨 Make it POP 🎨**
|
|
122
|
+
Customize the text frame to bring it all together.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
- :mouse pointer: From ``||game:Game||``, grab
|
|
127
|
+
|
|
128
|
+
```block
|
|
129
|
+
game.setDialogFrame(sprites.dialog.mediumLeaf1)
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
and snap it in at **the top** of the<br/>
|
|
133
|
+
``||controller(noclick):on [A] button [pressed]||``<br/>
|
|
134
|
+
container that is already in your workspace.
|
|
135
|
+
|
|
136
|
+
- :mouse pointer: Choose a design by clicking on the box in the<br/>
|
|
137
|
+
``||game(onclick):set dialog frame to [ ]||``<br/>
|
|
138
|
+
block and switching to the **Gallery**.
|
|
139
|
+
|
|
140
|
+
~hint Click here to see how 🕵🏽
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+

|
|
145
|
+
hint~
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
#### ~ tutorialhint
|
|
149
|
+
``` blocks
|
|
150
|
+
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
151
|
+
game.setDialogFrame(sprites.dialog.mediumLeaf1)
|
|
152
|
+
game.showLongText("Happy Earth Day", DialogLayout.Bottom)
|
|
153
|
+
game.showLongText("To the greatest Earth I know", DialogLayout.Bottom)
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
## {Step 8}
|
|
161
|
+
|
|
162
|
+
**Try it again.**
|
|
163
|
+
|
|
164
|
+
- :binoculars: Take a look at the game window and press the
|
|
165
|
+
**A button** (or space bar) to see your text. Press the button again to see the next message.
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
## {Step 9}
|
|
172
|
+
|
|
173
|
+
**The final touch 🎀**
|
|
174
|
+
|
|
175
|
+
Change the color of the text so it works with your background.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
- :circle: From ``||game:Game||``, grab
|
|
180
|
+
|
|
181
|
+
```block
|
|
182
|
+
game.setDialogTextColor(1)
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
and snap it into the top of the<br/>
|
|
186
|
+
``||on [A] button [pressed]||``<br/>
|
|
187
|
+
block in your workspace.
|
|
188
|
+
|
|
189
|
+
- :mouse pointer: **Click the box** and choose a color that looks good with your message. <br/><br/>
|
|
190
|
+
It's okay if you need to change it a few times before your text
|
|
191
|
+
is just right.
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
~hint Click here to see how 🕵🏽
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+

|
|
199
|
+
hint~
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
#### ~ tutorialhint
|
|
203
|
+
``` blocks
|
|
204
|
+
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
205
|
+
game.setDialogTextColor(1)
|
|
206
|
+
game.setDialogFrame(sprites.dialog.mediumLeaf1)
|
|
207
|
+
game.showLongText("Happy Earth Day", DialogLayout.Bottom)
|
|
208
|
+
game.showLongText("To the greatest Earth I know", DialogLayout.Bottom)
|
|
209
|
+
})
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
## {Step 10}
|
|
215
|
+
|
|
216
|
+
**Look at your final card.**
|
|
217
|
+
|
|
218
|
+
- :binoculars: Take a look at the game window and press the
|
|
219
|
+
**A button** (or space bar) to see how your text looks now.
|
|
220
|
+
<br/><br/>Press the button another time to see the next message.
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
## {Finale}
|
|
227
|
+
|
|
228
|
+
**🎊 Congrats 🎊**
|
|
229
|
+
|
|
230
|
+
Now you have a card that any friend would be excited to get!
|
|
231
|
+
|
|
232
|
+
Click **Done** to return to the main skillmap to move on to the next level where you will create a joke!
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
```blockconfig.global
|
|
236
|
+
carnival.addLabelTo("You Are Awesome", carnival.Areas.Top)
|
|
237
|
+
|
|
238
|
+
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
239
|
+
game.showLongText("Happy Earth Day", DialogLayout.Bottom)
|
|
240
|
+
})
|
|
241
|
+
game.showLongText("To the greatest Earth I know", DialogLayout.Bottom)
|
|
242
|
+
game.setDialogFrame(sprites.dialog.mediumLeaf1)
|
|
243
|
+
game.setDialogTextColor(1)
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
```package
|
|
249
|
+
carnival=github:microsoft/arcade-tutorial-extensions/carnival/
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
```template
|
|
254
|
+
{
|
|
255
|
+
scene.setBackgroundImage(storySprites.world)
|
|
256
|
+
effects.confetti.startScreenEffect()
|
|
257
|
+
music.startSong(assets.song`birthday`, false)
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
```ghost
|
|
263
|
+
scene.setBackgroundColor(0)
|
|
264
|
+
scene.setBackgroundImage(img`
|
|
265
|
+
.
|
|
266
|
+
`, SpriteKind.Player)
|
|
267
|
+
mySprite.setPosition(0, 0)
|
|
268
|
+
forever(function () {
|
|
269
|
+
for (let index = 0; index < 4; index++) {
|
|
270
|
+
|
|
271
|
+
}
|
|
272
|
+
})
|
|
273
|
+
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
```assetjson
|
|
278
|
+
|
|
279
|
+
{
|
|
280
|
+
"README.md": " ",
|
|
281
|
+
"assets.json": "",
|
|
282
|
+
"images.g.jres": "{\n \"song2\": {\n \"data\": \"0078000408060107001c00020a006400f401640000040000000000000000000000000000000000a80000000200012504000600012508000c0001270e001000012514001800012a18001e00012920002200012524002600012528002c0001272e003000012534003800012c38003e00012a40004200012544004600012548004c0001314c005000012e50005200012a52005400012a54005600012956005800012958005a0001275a006200012762006600013068006c0001306e007400012e76007c00012a7e008000012c82008400012a\",\n \"mimeType\": \"application/mkcd-song\",\n \"displayName\": \"birthday\"\n },\n \"song1\": {\n \"data\": \"0078000408020202001c00010a006400f40164000004000000000000000000000000000500000077000000040002423c0400080002413a08000c00023f380c001000023d3610001400023c3514001800023d3618001c00023f381c002000023c3522002400023d3624002600023f382600280002413a28002a00023d362a002e00023f3830003200023d3632003400023c3536003800023a333a004000023c3507001c00020a006400f401640000040000000000000000000000000000000000660000000200013004000600012e08000a00012c0c000e00012a10001200012914001600012a18001a00012c1c001e00012922002400012a24002600012c26002800012e28002a00012a2a002c00012c30003200012a3200340001293600380001273a003c000129\",\n \"mimeType\": \"application/mkcd-song\",\n \"displayName\": \"Noel Halls\"\n },\n \"*\": {\n \"mimeType\": \"image/x-mkcd-f4\",\n \"dataEncoding\": \"base64\",\n \"namespace\": \"myImages\"\n }\n}",
|
|
283
|
+
"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\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 helpers._registerFactory(\"song\", function(name: string) {\n switch(helpers.stringTrim(name)) {\n case \"song2\":\n case \"birthday\":return hex`0078000408060107001c00020a006400f401640000040000000000000000000000000000000000a80000000200012504000600012508000c0001270e001000012514001800012a18001e00012920002200012524002600012528002c0001272e003000012534003800012c38003e00012a40004200012544004600012548004c0001314c005000012e50005200012a52005400012a54005600012956005800012958005a0001275a006200012762006600013068006c0001306e007400012e76007c00012a7e008000012c82008400012a`;\n case \"song1\":\n case \"Noel Halls\":return hex`0078000408020202001c00010a006400f40164000004000000000000000000000000000500000077000000040002423c0400080002413a08000c00023f380c001000023d3610001400023c3514001800023d3618001c00023f381c002000023c3522002400023d3624002600023f382600280002413a28002a00023d362a002e00023f3830003200023d3632003400023c3536003800023a333a004000023c3507001c00020a006400f401640000040000000000000000000000000000000000660000000200013004000600012e08000a00012c0c000e00012a10001200012914001600012a18001a00012c1c001e00012922002400012a24002600012c26002800012e28002a00012a2a002c00012c30003200012a3200340001293600380001273a003c000129`;\n }\n return null;\n })\n\n}\n// Auto-generated code. Do not edit.\n",
|
|
284
|
+
"main.blocks": "<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"pxt-on-start\" x=\"0\" y=\"0\"></block></xml>",
|
|
285
|
+
"main.ts": "\n",
|
|
286
|
+
"pxt.json": "{\n \"name\": \"Untitled - Copy - Copy - Copy\",\n \"description\": \"\",\n \"dependencies\": {\n \"device\": \"*\",\n \"carnival\": \"github:microsoft/arcade-carnival#v0.0.3\"\n },\n \"files\": [\n \"main.blocks\",\n \"main.ts\",\n \"README.md\",\n \"assets.json\",\n \"images.g.jres\",\n \"images.g.ts\"\n ],\n \"targetVersions\": {\n \"branch\": \"v1.11.21\",\n \"tag\": \"v1.11.21\",\n \"commits\": \"https://github.com/microsoft/pxt-arcade/commits/5fb4210ecb70e5d405aa1a5701b4408b5bfe9094\",\n \"target\": \"1.11.21\",\n \"pxt\": \"8.4.15\"\n },\n \"preferredEditor\": \"blocksprj\"\n}\n"
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
```
|