Skip to content

Commit

Permalink
Merge pull request #29 from CausewayDigital/master
Browse files Browse the repository at this point in the history
Rewrite computing unit 1 lesson 3
  • Loading branch information
gbaman authored Mar 31, 2022
2 parents 0114ce5 + b429481 commit 31eb332
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions computing/unit-1/lesson-3.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,25 @@
### @hideIteration false
### @explicitHints 1
### @hideIteration true
### @explicitHints true


# Lesson 3

## Step 1
To program your Agent to build, select an ``||player:on chat||`` command and rename it from **run** to **build_a_bridge**. Select an ``||agent: agent place on move||`` command and drag it inside the ``||player:on chat||`` command.

### ~ tutorialhint
Don't forget to set the condition to **true**, so that the Agent will be able to build.

## Step 3
Identify **direction** in which you would like the Agent to place blocks by selecting an ``||agent: agent place||``.

## Step 4
Now add an ``||agent: agent move||`` command to ensure that the Agent moves in the right direction.
With everything you have learnt so far, can you code your agent to build a bridge across the water?
The gap is 3 blocks wide.
When done, press the **Play** button to compile the code, then go to the Minecraft world, press **T** and type **build_a_bridge**.

### ~ tutorialhint
Make sure your Agent has **building material** in its inventory. The blocks should be in **slot 1**.

## Step 5
When done, press the **Play** button to compile the code, then go to the Minecraft world, press **T** and type **build_a_bridge**.
Don't forget to place **down** when placing blocks!
Also make sure your Agent has **building material** in its inventory. The blocks should be in **slot 1**.

## Step 6
Now you can practice using these commands in different combinations.

```ghost
player.onChat("run", function () {
player.say(":)")
agent.teleportToPlayer()
agent.turn(LEFT_TURN)
agent.move(FORWARD, 1)
agent.destroy(FORWARD)
agent.collectAll()
agent.setAssist(PLACE_ON_MOVE, false)
agent.place(FORWARD)
})
```
Expand Down

0 comments on commit 31eb332

Please sign in to comment.