Skip to content

Commit c7a2cbf

Browse files
authored
Remove unicode chars from variable bat_js.md
1 parent 280530b commit c7a2cbf

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

tutorials/variable/intermediate/bat_js.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
# Bat Cave: JavaScript
1+
# Bat Cave: Blocks
22

33
## Step 1
4-
Add an ``||player:on chat||`` command and name it **cave**.
4+
Rename the existing ``||player:on chat||`` command **cave**.
55

6-
```javascript
6+
```blocks
77
player.onChat("cave", function () {
88
})
99
```
1010

1111
## Step 2
1212

13-
Code the player to ``||player:say||``by typing **"Dig a cave"**, and drag it into the ``||player:on chat||`` command.
13+
Get a ``||player:player say||`` command, type **"Dig a cave"**, and drag it into the ``||player:on chat||`` command.
1414

15-
```javascript
15+
```blocks
1616
player.onChat("cave", function () {
1717
player.say("Dig a cave")
1818
})
1919
```
2020

2121
## Step 3
2222

23-
Set the time of day to **day**.
23+
Get a ``||gameplay:time set||`` block, set it **day**, and drag it into the ``||player:on chat||`` **cave** command - below the ``||player:say||`` command.
2424

25-
```javascript
25+
```blocks
2626
player.onChat("cave", function () {
2727
player.say("Dig a cave")
2828
gameplay.timeSet(gameplay.time(DAY))
@@ -31,9 +31,9 @@ player.onChat("cave", function () {
3131

3232
## Step 4
3333

34-
Code the player to ``||blocks:fill with||`` an **air** block with these positions: **from = -1.0,-1** and **to = 1,2,1**. Code it to **replace**.
34+
Get a ``||blocks:fill with||`` block and select an **air** block with these positions: **from -1.0,-1** and **to 1,2,1**. Set it to **replace**.
3535

36-
```javascript
36+
```blocks
3737
player.onChat("cave", function () {
3838
player.say("Dig a cave")
3939
gameplay.timeSet(gameplay.time(DAY))
@@ -48,9 +48,9 @@ player.onChat("cave", function () {
4848

4949
## Step 5
5050

51-
Repeat the fill step **50** times.
51+
Get a ``||loops:repeat||`` loop and set it to **50** times. Drag the ``||blocks:fill with||`` **air** block into the loop, then drag the entire ``||loops:repeat||`` loop into the ``||player:on chat||`` **cave** command below the ``||gameplay:time set||`` **day** command.
5252

53-
```javascript
53+
```blocks
5454
player.onChat("cave", function () {
5555
player.say("Dig a cave")
5656
gameplay.timeSet(gameplay.time(DAY))
@@ -67,9 +67,10 @@ player.onChat("cave", function () {
6767

6868
## Step 6
6969

70-
Set a ``||variables:new variable||`` and name it **bat_cave**, then set that variable to the ``||player:player world position||``.
70+
Get a ``||variables:set variable||`` and assign it a new variable called **bat_cave**. Get a ``||player:player world position||`` and drag it into the **bat_cave** variable.
71+
Drag the newly completed ``||variables:set variable||`` **bat_cave** into the ``||player:on chat||`` command **cave** below the ``||loops:repeat||`` loop **50**.
7172

72-
```javascript
73+
```blocks
7374
let batcave: Position = null
7475
player.onChat("cave", function () {
7576
player.say("Dig a cave")
@@ -88,53 +89,53 @@ player.onChat("cave", function () {
8889

8990
## Step 7
9091

91-
Code the player to ``||player:say||`` You have 10 seconds to go out before the bats arrive.
92+
Get a ``||player:say||`` block and code it as "You have 10 seconds to go out before the bats arrive." Drag it into the ``||player:on chat||`` **cave** command below the **bat_cave** variable.
9293

93-
```javascript
94+
```blocks
9495
player.say("You have 10 seconds to get out before the bats arrive.")
9596
```
9697

9798
## Step 8
9899

99-
``||loops: Pause||`` the code for **10** seconds (10,000 ms).
100+
Get a ``||loops: pause||`` loop and set it to **10** seconds (10,000 ms). Drag this loop into the end of the ``||player:on chat||`` command.
100101

101-
```javascript
102+
```blocks
102103
player.say("You have 10 seconds to get out before the bats arrive.")
103104
loops.pause(10000)
104105
player.on_chat("cave", on_chat)
105106
```
106107

107108
## Step 9
108109

109-
After the pause, code the player to sayWatch out for bats!”.
110+
Get another ``||player:player say||``command and code the player to say, "Watch out for bats!". Drag the newly completed ``||player:player say||`` into the ``||player:on chat||`` command at the end.
110111

111-
```spy
112+
```blocks
112113
loops.pause(10000)
113114
player.say("Watch out for bats!")
114115
player.on_chat("cave", on_chat)
115116
```
116117

117118
## Step 10
118119

119-
Set the time to **dusk**.
120+
Duplicate the ``||gameplay:time set||`` **day** (from step 3) and set it to **dusk**. Drag it into the end of the ``||player:on chat||`` command.
120121

121-
```javascript
122+
```blocks
122123
gameplay.timeSet(gameplay.time(DUSK))
123124
```
124125

125126
## Step 11
126127

127-
``||mobs:Spawn||`` a bat at the **bat_cave** variable.
128+
Get a ``||mobs:spawn animal||`` block and drag it into the workspace, select **bat** and assign the **bat_cave** variable.
128129

129-
```javascript
130+
```blocks
130131
mobs.spawn(BAT, batcave)
131132
```
132133

133134
## Step 12
134135

135-
Repeat the **bat** ``||mobs:spawn animal||`` **200** times.
136+
Next, repeat the **bat** ``||mobs:spawn animal||`` step. Get a ``||loops:repeat||`` loop and set it to **200** times. Drag the **bat** into the loop. Drag the entire loop into the ``||player:on chat||`` **cave** command below the ``||gameplay:time set||`` **dusk** block.
136137

137-
```javascript
138+
```blocks
138139
for (let index = 0; index < 200; index++) {
139140
mobs.spawn(BAT, batcave)
140141
}
@@ -144,8 +145,7 @@ for (let index = 0; index < 200; index++) {
144145

145146
Go into Minecraft and type **cave** in the chat to see all the code run.
146147

147-
148-
```javascript
148+
```blocks
149149
let batcave: Position = null
150150
player.onChat("cave", function () {
151151
player.say("Dig a cave")

0 commit comments

Comments
 (0)