pxt-arcade 1.13.11 β 1.13.13
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 +4 -0
- package/built/common-sim.js +187 -0
- package/built/sim.js +420 -67
- package/built/target.js +1 -1
- package/built/target.json +1 -1
- package/built/targetlight.json +1 -1
- package/built/theme.json +1 -1
- package/docs/concepts/bouncing-burger.md +5 -5
- package/docs/concepts/breadcrumb-trail.md +4 -4
- package/docs/concepts/picnic-food.md +6 -6
- package/docs/concepts/princess-pizza.md +4 -4
- package/docs/concepts/setting-the-scene.md +2 -2
- package/docs/concepts/throw-a-bone.md +5 -5
- package/docs/concepts/walking-hero.md +3 -3
- package/docs/lessons/barrel-dodger.md +3 -3
- package/docs/multiplayer-games.md +12 -12
- package/docs/projects/SUMMARY.md +6 -6
- package/docs/recipes/shark-splash/01-character.md +3 -3
- package/docs/recipes/shark-splash/02-A-enemies.md +2 -2
- package/docs/recipes/shark-splash/02-enemies.md +5 -5
- package/docs/recipes/shark-splash/04-background.md +3 -3
- package/docs/recipes/side-scroller/02-create-car.md +2 -2
- package/docs/skillmaps.md +2 -0
- package/docs/static/badges/badge-adventure-locked.png +0 -0
- package/docs/static/badges/badge-adventure.png +0 -0
- package/docs/static/skillmap/racer/share.png +0 -0
- package/docs/test/skillmap/dino/dino3.md +1 -0
- package/docs/test/skillmap/racer/racer1.md +87 -78
- package/docs/test/skillmap/racer/racer2.md +50 -55
- package/docs/test/skillmap/racer/racer3.md +113 -27
- package/docs/test/skillmap/racer.md +69 -0
- package/docs/test/skillmap/space/space1.md +205 -0
- package/docs/test/skillmap/space/space2.md +186 -0
- package/docs/test/skillmap/space/space3.md +374 -0
- package/docs/test/skillmap/space/space4.md +409 -0
- package/docs/test/skillmap/space/space4a.md +291 -0
- package/docs/test/skillmap/space/space5.md +433 -0
- package/docs/test/skillmap/space/space6.md +343 -0
- package/docs/test/skillmap/space.md +109 -0
- package/docs/test/skillmap/star/star1.md +7 -31
- package/docs/test/skillmap/star/star2.md +4 -1
- package/docs/test/skillmap/star/star4.md +54 -3
- package/docs/test/tutorials/birthday.md +2 -2
- package/docs/test/tutorials/blazing.md +18 -5
- package/docs/tutorials/catch-the-football.md +8 -8
- package/docs/tutorials/chase-the-basketball.md +5 -5
- package/docs/tutorials/free-throw.md +4 -4
- package/package.json +4 -4
- package/pxtarget.json +1 -1
- package/targetconfig.json +1 -1
|
@@ -138,7 +138,7 @@ scene.setBackgroundImage(img`
|
|
|
138
138
|
|
|
139
139
|
## {Decorative sprites}
|
|
140
140
|
|
|
141
|
-
Next, let's add some sprites to decorate your game. From ``||loops:Loops||``, drag the ``||loops:for index from||`` block into ``||loops:on start|`` and set the ``||variables:index||`` range to `10`.
|
|
141
|
+
Next, let's add some sprites to decorate your game. From ``||loops:Loops||``, drag the ``||loops:for index from||`` block into ``||loops:on start|`` and set the ``||variables(noclick):index||`` range to `10`.
|
|
142
142
|
|
|
143
143
|
```blocks
|
|
144
144
|
scene.setBackgroundImage(img`
|
|
@@ -269,7 +269,7 @@ for (let index = 0; index <= 10; index++) {
|
|
|
269
269
|
|
|
270
270
|
## {Add background sprite}
|
|
271
271
|
|
|
272
|
-
From ``||sprites:Sprites||``, drag the ``||variables:set mySprite to||`` block into ``||loops:for index from 0 to 10|``. Click on the grey box and in the image editor gallery, select a background object like a rock or some seaweed.
|
|
272
|
+
From ``||sprites:Sprites||``, drag the ``||variables(sprites):set mySprite to||`` block into ``||loops:for index from 0 to 10|``. Click on the grey box and in the image editor gallery, select a background object like a rock or some seaweed.
|
|
273
273
|
|
|
274
274
|
```blocks
|
|
275
275
|
scene.setBackgroundImage(img`
|
|
@@ -634,7 +634,7 @@ for (let index = 0; index <= 10; index++) {
|
|
|
634
634
|
|
|
635
635
|
## {Update sprite x-position}
|
|
636
636
|
|
|
637
|
-
From ``||math:Math||``, drag the ``||math:0 x 0||`` block in as the ``||sprites:x||`` value of ``||sprites:set mySprite position||``. Change the first number to `16`, and drag the ``||variables:index||`` block for the second number. Continue adding decorations until you are satisifed with your scene!
|
|
637
|
+
From ``||math:Math||``, drag the ``||math:0 x 0||`` block in as the ``||sprites:x||`` value of ``||sprites:set mySprite position||``. Change the first number to `16`, and drag the ``||variables(noclick):index||`` block for the second number. Continue adding decorations until you are satisifed with your scene!
|
|
638
638
|
|
|
639
639
|
```blocks
|
|
640
640
|
scene.setBackgroundImage(img`
|
|
@@ -8,7 +8,7 @@ Create motion sprite to move a race car along a race track tilemap.
|
|
|
8
8
|
|
|
9
9
|
## {Step 1 - Create a player sprite}
|
|
10
10
|
|
|
11
|
-
From the ``||sprites:Sprites||`` Toolbox drawer, drag a ``||variables:set mySprite||`` block into the ``||loops:on start||`` block after the ``||scene:set tilemap||`` block.
|
|
11
|
+
From the ``||sprites:Sprites||`` Toolbox drawer, drag a ``||variables(sprites):set mySprite||`` block into the ``||loops:on start||`` block after the ``||scene:set tilemap||`` block.
|
|
12
12
|
|
|
13
13
|
```blocks
|
|
14
14
|
scene.setBackgroundColor(6)
|
|
@@ -64,7 +64,7 @@ let mySprite = sprites.create(img`
|
|
|
64
64
|
|
|
65
65
|
Letβs add code to simulate gravity pulling our car down. We can do this by adding an acceleration force to our car.
|
|
66
66
|
|
|
67
|
-
From the ``||sprites:Sprites||`` Toolbox drawer, drag a ``||sprites:set mySprite x to 0||`` block and drop after the ``||variables:set mySprite||`` block.
|
|
67
|
+
From the ``||sprites:Sprites||`` Toolbox drawer, drag a ``||sprites:set mySprite x to 0||`` block and drop after the ``||variables(sprites):set mySprite||`` block.
|
|
68
68
|
|
|
69
69
|
## {Step 4 - Set acceleration}
|
|
70
70
|
|
package/docs/skillmaps.md
CHANGED
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
"description": "Code a text-based adventure game using your own images, storyline, and music score!",
|
|
22
22
|
"imageUrl": "/static/skillmap/backgrounds/adventure-map.png",
|
|
23
23
|
"url": "https://arcade.makecode.com/--skillmap#adventure",
|
|
24
|
+
"label": "Limited time only",
|
|
25
|
+
"labelClass": "purple ribbon",
|
|
24
26
|
"directOpen": true
|
|
25
27
|
},
|
|
26
28
|
{
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -11,36 +11,68 @@ In this tutorial, you'll add a truck to your game and make it move through a cav
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
## {
|
|
14
|
+
## {2. Add the Truck}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Before we can add a truck, we need to create a [__*sprite*__](#sprote "a 2-D image that moves on the screen").
|
|
17
|
+
|
|
18
|
+
~hint What's a sprite? π‘
|
|
17
19
|
|
|
18
20
|
---
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
In Arcade, each character or image that does something is called a **SPRITE**.
|
|
23
|
+
|
|
24
|
+
Sprites have properties that you can use and change -- things like scale, position, and lifespan are all properties of sprites.
|
|
25
|
+
|
|
26
|
+
Our truck will be a sprite, too.
|
|
27
|
+
|
|
28
|
+
hint~
|
|
29
|
+
|
|
30
|
+
- :paper plane: From the ``||sprites:Sprites||`` category, drag<br/>
|
|
31
|
+
``||variables(sprites):set [truck] to sprite [ ] of kind [Player]||``<br/>
|
|
32
|
+
to **the end** of the empty<br/>
|
|
33
|
+
``||loops(noclick):on start||`` <br/>
|
|
34
|
+
container in the workspace.
|
|
35
|
+
|
|
21
36
|
|
|
37
|
+
~hint What does that mean? π€·π½
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
In this tutorial, we'll use formatted text to help you know which blocks you need. For example, when we ask you to look for: <br/>
|
|
42
|
+
``||variables(sprites):set [truck] to sprite [ ] of kind [Player]||``<br/>
|
|
43
|
+
we're talking about this block:<br/>
|
|
22
44
|
```block
|
|
23
45
|
let truck = sprites.create(img`.`, SpriteKind.Player)
|
|
24
46
|
```
|
|
25
|
-
|
|
26
|
-
``||loops:on start||`` <br/>
|
|
27
|
-
container.
|
|
47
|
+
Need help finding the category? Click on the highlighted text and we'll open the drawer for you.
|
|
28
48
|
|
|
29
|
-
|
|
49
|
+
hint~
|
|
30
50
|
|
|
31
|
-

|
|
32
51
|
|
|
33
|
-
|
|
52
|
+
#### ~ tutorialhint
|
|
34
53
|
|
|
35
|
-
|
|
54
|
+
```blocks
|
|
55
|
+
// @highlight
|
|
56
|
+
let truck = sprites.create(img`.`, SpriteKind.Player)
|
|
57
|
+
```
|
|
36
58
|
|
|
37
|
-
~hint Click here to see how π΅π½
|
|
38
59
|
|
|
39
|
-

|
|
40
60
|
|
|
41
|
-
hint~
|
|
42
61
|
|
|
43
|
-
|
|
62
|
+
## {3. Add the Truck}
|
|
63
|
+
|
|
64
|
+
**Choose your truck**
|
|
65
|
+
|
|
66
|
+
- :paint brush: To choose a truck, click the empty box inside<br/>
|
|
67
|
+
``||variables(noclick):set [truck] to sprite [ ] of kind [Player]||``<br/>
|
|
68
|
+
then switch to **My Assets**
|
|
69
|
+

|
|
70
|
+
and choose a truck.<br/><br/>
|
|
71
|
+
_π‘ This image shows the **truck2** sprite, but you can use whichever truck you want._
|
|
72
|
+

|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
44
76
|
|
|
45
77
|
#### ~ tutorialhint
|
|
46
78
|
|
|
@@ -51,38 +83,39 @@ let truck = sprites.create(assets.image`truck2`, SpriteKind.Player)
|
|
|
51
83
|
|
|
52
84
|
|
|
53
85
|
|
|
86
|
+
|
|
87
|
+
## {Step 4}
|
|
88
|
+
|
|
89
|
+
- :binoculars: Take a look at the game window.
|
|
90
|
+
|
|
91
|
+
Do you see the truck hovering in the cave?
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+

|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
54
99
|
## {5. Add Gravity}
|
|
55
100
|
|
|
56
|
-
To
|
|
101
|
+
To get your game going, it needs gravity.
|
|
57
102
|
|
|
58
103
|
~hint How do I add gravity? π₯
|
|
59
104
|
|
|
105
|
+
---
|
|
106
|
+
|
|
60
107
|
For gravity, we'll add [__*acceleration*__](#accel "increased speed in a direction")
|
|
61
|
-
to "pull down" on the sprite. This is done by setting the sprite's
|
|
62
|
-
acceleration, **ay**, value.
|
|
108
|
+
to "pull down" on the sprite. This is done by setting the sprite's **ay** (acceleration in the direction of 'y').
|
|
63
109
|
|
|
64
110
|
hint~
|
|
65
111
|
|
|
66
|
-
---
|
|
67
112
|
|
|
68
113
|
- :paper plane: From the ``||sprites:Sprites||`` category, drag <br/>
|
|
69
|
-
|
|
70
|
-
```block
|
|
71
|
-
let truck: Sprite = null
|
|
72
|
-
truck.ay = 500
|
|
73
|
-
```
|
|
114
|
+
``||sprites:set [truck] [ay (acceleration y) to [500]||``<br/>
|
|
74
115
|
to **the end** of the <br/>
|
|
75
|
-
``||loops:on start||`` container.
|
|
76
|
-
|
|
77
|
-
---
|
|
116
|
+
``||loops(noclick):on start||`` container.
|
|
78
117
|
|
|
79
|
-
~hint Click here to see how π΅π½
|
|
80
118
|
|
|
81
|
-
")
|
|
82
|
-
|
|
83
|
-
hint~
|
|
84
|
-
|
|
85
|
-
- :mouse pointer: When you're ready to continue, click **Next**.
|
|
86
119
|
|
|
87
120
|
```blockconfig.local
|
|
88
121
|
let truck: Sprite = null
|
|
@@ -92,8 +125,6 @@ truck.ay = 500
|
|
|
92
125
|
#### ~ tutorialhint
|
|
93
126
|
|
|
94
127
|
```blocks
|
|
95
|
-
tiles.setTilemap(tilemap`level1`)
|
|
96
|
-
scene.setBackgroundImage(assets.image`background`)
|
|
97
128
|
let truck = sprites.create(assets.image`truck1`, SpriteKind.Player)
|
|
98
129
|
// @highlight
|
|
99
130
|
truck.ay = 500
|
|
@@ -101,17 +132,13 @@ truck.ay = 500
|
|
|
101
132
|
|
|
102
133
|
|
|
103
134
|
|
|
104
|
-
## {6. Take a Look!}
|
|
105
135
|
|
|
106
|
-
|
|
136
|
+
## {Step 6}
|
|
107
137
|
|
|
108
|
-
|
|
138
|
+
- :binoculars: Look at the game window again.
|
|
109
139
|
|
|
110
|
-
|
|
140
|
+
Did the truck fall to the ground?
|
|
111
141
|
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
- :mouse pointer: When you're ready to continue, click **Next**.
|
|
115
142
|
|
|
116
143
|
|
|
117
144
|
|
|
@@ -119,32 +146,21 @@ The truck should drop to the ground inside the cave.
|
|
|
119
146
|
|
|
120
147
|
In this game, your truck needs to start rolling as soon as the game starts.
|
|
121
148
|
|
|
122
|
-
~hint How do I make
|
|
123
|
-
|
|
124
|
-
To make the truck move, you need to set its **vx** or _horizontal velocity_ (speed from side to side).
|
|
125
|
-
|
|
126
|
-
hint~
|
|
149
|
+
~hint How do I make it move? π»
|
|
127
150
|
|
|
128
151
|
---
|
|
129
152
|
|
|
130
|
-
|
|
153
|
+
To make the truck move to the right, you need to set its **vx** (velocity in the direction of 'x') to a positive number.
|
|
131
154
|
|
|
132
|
-
|
|
133
|
-
let truck: Sprite = null
|
|
134
|
-
truck.vx = 100
|
|
135
|
-
```
|
|
136
|
-
to **the end** of the <br/>
|
|
137
|
-
``||loops:on start||`` container.
|
|
138
|
-
|
|
139
|
-
---
|
|
155
|
+
hint~
|
|
140
156
|
|
|
141
|
-
- :mouse pointer: When you're ready to continue, click **Next**.
|
|
142
157
|
|
|
143
|
-
|
|
158
|
+
- :paper plane: From ``||sprites:Sprites||``, drag<br/>
|
|
159
|
+
``||sprites:set [truck] [vx (velocity x)] to [100]||``<br/>
|
|
160
|
+
to **the end** of the <br/>
|
|
161
|
+
``||loops(onclick):on start||`` container.
|
|
144
162
|
|
|
145
|
-
")
|
|
146
163
|
|
|
147
|
-
hint~
|
|
148
164
|
|
|
149
165
|
```blockconfig.local
|
|
150
166
|
let truck: Sprite = null
|
|
@@ -160,37 +176,28 @@ truck.ay = 500
|
|
|
160
176
|
truck.vx = 100
|
|
161
177
|
```
|
|
162
178
|
|
|
163
|
-
## {8. Try It!}
|
|
164
179
|
|
|
165
|
-
Open the game window again and check out the game you have so far.
|
|
166
180
|
|
|
167
|
-
|
|
168
|
-
|
|
181
|
+
## {Step 8}
|
|
182
|
+
|
|
183
|
+
- :binoculars: Look at the game window again and watch your truck mosey.
|
|
169
184
|
|
|
170
|
-
---
|
|
171
185
|
|
|
172
|
-
- :mouse pointer: When you're ready to continue, click **Next**.
|
|
173
186
|
|
|
174
187
|
|
|
175
188
|
## {9. Follow that Sprite}
|
|
176
189
|
|
|
177
|
-
Did you notice that your truck
|
|
190
|
+
**Did you notice that your truck drives off-screen?**
|
|
178
191
|
|
|
179
|
-
Let's make the "camera" follow the sprite so you can always see it.
|
|
192
|
+
Let's make the game "camera" follow the sprite so you can always see it.
|
|
180
193
|
|
|
181
194
|
---
|
|
182
195
|
|
|
183
196
|
- :tree: To keep the truck in sight, go to ``||scene:Scene||`` and drag <br/>
|
|
184
|
-
|
|
185
|
-
```block
|
|
186
|
-
scene.cameraFollowSprite(truck)
|
|
187
|
-
```
|
|
197
|
+
``||scene:camera follow sprite [truck]||``<br/>
|
|
188
198
|
to **the end** of the <br/>
|
|
189
|
-
``||loops:on start||`` container.
|
|
190
|
-
|
|
191
|
-
---
|
|
199
|
+
``||loops(noclick):on start||`` container.
|
|
192
200
|
|
|
193
|
-
- :mouse pointer: When you're ready to continue, click **Next**.
|
|
194
201
|
|
|
195
202
|
|
|
196
203
|
#### ~ tutorialhint
|
|
@@ -207,11 +214,13 @@ scene.cameraFollowSprite(truck)
|
|
|
207
214
|
|
|
208
215
|
## {Finale}
|
|
209
216
|
|
|
210
|
-
|
|
217
|
+
**β¨Woohoo!β¨**
|
|
218
|
+
|
|
219
|
+
Take a look at what you've done so far.
|
|
211
220
|
|
|
212
|
-
|
|
221
|
+
Your truck should start rolling as soon as the game loads and keep going until it gets to the end of the first pit!
|
|
213
222
|
|
|
214
|
-
When you're ready, click **Done** to head back out to the skillmap
|
|
223
|
+
When you're ready, click **Done** to head back out to the skillmap and keep going to find out how to control your truck with arrows and buttons!
|
|
215
224
|
|
|
216
225
|
|
|
217
226
|
```blockconfig.global
|
|
@@ -12,7 +12,7 @@ Now that you have a truck that moves, let's add the ability to jump and navigate
|
|
|
12
12
|
|
|
13
13
|
## {2. Remember}
|
|
14
14
|
|
|
15
|
-
Take a look at the code that's already in your workspace
|
|
15
|
+
**Take a look at the code that's already in your workspace.**
|
|
16
16
|
|
|
17
17
|
You should see the blocks that add gravity, make your truck start moving, and set the camera to follow you through the cave.
|
|
18
18
|
|
|
@@ -21,30 +21,20 @@ You should see the blocks that add gravity, make your truck start moving, and se
|
|
|
21
21
|
|
|
22
22
|
## {3. Make the Jump}
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
**See the pits of acid in the road?**
|
|
25
|
+
|
|
26
|
+
Make your truck avoid them when you press the (A) button (or space bar).
|
|
25
27
|
|
|
26
28
|
---
|
|
27
29
|
|
|
28
30
|
|
|
29
|
-
- :game: From ``||controller:Controller||``, drag the
|
|
31
|
+
- :game: From ``||controller:Controller||``, drag the<br/>
|
|
32
|
+
``||controller:on [A] button [pressed]||``<br/>
|
|
33
|
+
bundle into an **empty area** of the workspace.
|
|
30
34
|
|
|
31
|
-
```block
|
|
32
|
-
let truck: Sprite = null
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
truck.vy = 0
|
|
36
|
-
})
|
|
37
|
-
```
|
|
38
|
-
container into an empty area of the workspace.
|
|
36
|
+
Now, each time you press the (A) button, the truck will jump until gravity pulls it back down.
|
|
39
37
|
|
|
40
|
-
- :mouse pointer: Change **0** to **-200** to send the truck upward with each press of the (A) button.
|
|
41
|
-
|
|
42
|
-
```blockconfig.local
|
|
43
|
-
let truck: Sprite = null
|
|
44
|
-
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
45
|
-
truck.vy = 0
|
|
46
|
-
})
|
|
47
|
-
```
|
|
48
38
|
|
|
49
39
|
#### ~ tutorialhint
|
|
50
40
|
|
|
@@ -57,41 +47,27 @@ controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
|
57
47
|
```
|
|
58
48
|
|
|
59
49
|
|
|
50
|
+
## {Step 4}
|
|
60
51
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
Remember to play your game again each time you make a change.
|
|
64
|
-
|
|
65
|
-
Can you see the effects of the code you just wrote?
|
|
66
|
-
|
|
52
|
+
- :binoculars: Remember to keep looking back at the game window to see how your game changes with each bit of code you add.
|
|
67
53
|
|
|
68
54
|
|
|
69
55
|
|
|
70
56
|
## {5. The Pits}
|
|
71
57
|
|
|
72
58
|
|
|
73
|
-
Now that you can jump the pits, let's make them dangerous
|
|
59
|
+
**Now that you can jump the pits, let's make them dangerous.**
|
|
74
60
|
|
|
75
61
|
---
|
|
76
62
|
|
|
77
63
|
- :tree: From ``||scene:Scene||``, drag the <br/>
|
|
64
|
+
``||scene:on [sprite] of kind [Player] overlaps [ ] at [location]||``<br/>
|
|
65
|
+
bundle into an **empty area** of the workspace.
|
|
78
66
|
|
|
79
|
-
|
|
80
|
-
scene.onOverlapTile(SpriteKind.Player, assets.tile`acid`, function (sprite, location) {
|
|
81
|
-
game.over(false)
|
|
82
|
-
})
|
|
83
|
-
```
|
|
84
|
-
container into an empty area of the workspace.
|
|
85
|
-
|
|
86
|
-
- :paint brush: Click the checkerboard image and change it to the **acid** tile.<br/>
|
|
67
|
+
- :paint brush: Click the empty tile image and change it to the **acid** tile.<br/>
|
|
87
68
|

|
|
88
69
|
|
|
89
70
|
|
|
90
|
-
```blockconfig.local
|
|
91
|
-
scene.onOverlapTile(SpriteKind.Player, img`.`, function (sprite, location) {
|
|
92
|
-
game.over(false)
|
|
93
|
-
})
|
|
94
|
-
```
|
|
95
71
|
|
|
96
72
|
#### ~ tutorialhint
|
|
97
73
|
|
|
@@ -105,21 +81,21 @@ scene.onOverlapTile(SpriteKind.Player, assets.tile`acid`, function (sprite, loca
|
|
|
105
81
|
|
|
106
82
|
## {6. The Spikes}
|
|
107
83
|
|
|
108
|
-
|
|
84
|
+
**Don't fly into a spike!**
|
|
85
|
+
|
|
86
|
+
Let's make the spikes dangerous, too.
|
|
109
87
|
|
|
110
88
|
|
|
111
89
|
---
|
|
112
90
|
|
|
113
|
-
- :mouse pointer: Follow the same steps to end the game when your sprite overlaps the **spikes**
|
|
91
|
+
- :mouse pointer: Follow the same steps to end the game when your sprite overlaps the **spikes**
|
|
114
92
|

|
|
93
|
+
as you did for the **acid** tile.
|
|
94
|
+
|
|
115
95
|
|
|
116
96
|
_π‘ Need a little help figuring out what this step should look like? Click the lightbulb button below for a peek at the blocks we recommend._
|
|
117
97
|
|
|
118
|
-
|
|
119
|
-
scene.onOverlapTile(SpriteKind.Player, img`.`, function (sprite, location) {
|
|
120
|
-
game.over(false)
|
|
121
|
-
})
|
|
122
|
-
```
|
|
98
|
+
|
|
123
99
|
|
|
124
100
|
#### ~ tutorialhint
|
|
125
101
|
|
|
@@ -131,19 +107,17 @@ scene.onOverlapTile(SpriteKind.Player, assets.tile`spikes`, function (sprite, lo
|
|
|
131
107
|
|
|
132
108
|
|
|
133
109
|
|
|
134
|
-
## {7
|
|
110
|
+
## {Step 7}
|
|
135
111
|
|
|
136
|
-
|
|
112
|
+
- :binoculars: Take a look at the game window.
|
|
137
113
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
You should be able to jump the acid pits by pressing the (A) button and the game should end when you hit the acid or a spike.
|
|
114
|
+
You should be able to jump the acid pits by pressing the (A) button (or space bar) and the game should end when you hit the acid or a spike.
|
|
141
115
|
|
|
142
116
|
|
|
143
117
|
|
|
144
118
|
## {8. End of the Tunnel}
|
|
145
119
|
|
|
146
|
-
We have a way to lose, now we need a way to win
|
|
120
|
+
**We have a way to lose, now we need a way to win.**
|
|
147
121
|
|
|
148
122
|
At the end of the cave, there is a set of pure black **empty cave** tiles.
|
|
149
123
|
|
|
@@ -155,6 +129,13 @@ an **empty cave** tile as you did for the **acid** tile.
|
|
|
155
129
|

|
|
156
130
|
|
|
157
131
|
|
|
132
|
+
- :mouse pointer: This time, make sure the switch inside of the<br/>
|
|
133
|
+
``||game:game over < >||`` block is set to **`<WIN>`**.
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
_π‘ Need a little help figuring out what this step should look like? Click the lightbulb button below for a peek at the blocks we recommend._
|
|
137
|
+
|
|
138
|
+
|
|
158
139
|
```blockconfig.local
|
|
159
140
|
scene.onOverlapTile(SpriteKind.Player, img`.`, function (sprite, location) {
|
|
160
141
|
game.over(true)
|
|
@@ -169,22 +150,36 @@ scene.onOverlapTile(SpriteKind.Player, assets.tile`empty cave`, function (sprite
|
|
|
169
150
|
})
|
|
170
151
|
```
|
|
171
152
|
|
|
153
|
+
## {Step 7}
|
|
154
|
+
|
|
155
|
+
- :binoculars: Play your game!
|
|
156
|
+
|
|
157
|
+
Can you make it all the way to the end and win?
|
|
158
|
+
|
|
159
|
+
|
|
172
160
|
|
|
173
161
|
## {Finale}
|
|
174
162
|
|
|
175
163
|
Congratulations!
|
|
176
164
|
|
|
177
|
-
You've created
|
|
165
|
+
You've created a Monster Racer game!
|
|
166
|
+
|
|
167
|
+
Once you're finished playing,
|
|
168
|
+
click **Done** to head back out to the skillmap, then keep going to add
|
|
169
|
+
fun customizations to your game.
|
|
178
170
|
|
|
179
|
-
Race to the end of the cave and once you're finished playing,
|
|
180
|
-
click **Done** to head back out to the skillmap where you can
|
|
181
|
-
play the next level and add customizations to your game.
|
|
182
171
|
|
|
183
172
|
|
|
184
173
|
```blockconfig.global
|
|
185
174
|
let truck = sprites.create(img`.`, SpriteKind.Player)
|
|
186
175
|
truck.x = 0
|
|
187
176
|
scene.cameraFollowSprite(truck)
|
|
177
|
+
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
|
|
178
|
+
truck.vy = -200
|
|
179
|
+
})
|
|
180
|
+
scene.onOverlapTile(SpriteKind.Player, assets.tile`acid`, function (sprite, location) {
|
|
181
|
+
game.over(false)
|
|
182
|
+
})
|
|
188
183
|
```
|
|
189
184
|
|
|
190
185
|
```template
|