Skip to content

Commit

Permalink
Hovertext and collectAndCount() condition update
Browse files Browse the repository at this point in the history
  • Loading branch information
v-chyou authored Mar 21, 2020
1 parent d57fb31 commit 0d5451e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ namespace hourOfCode {
}

/**
* Checks whether the agent is standing on the gold block that represents the goal
* Checks whether the agent has reached the goal
*/
//% block = "goal not reached"
//% weight = 96
Expand All @@ -316,15 +316,15 @@ namespace hourOfCode {
}

/**
* Runs collectAll() and checks the number of items in agent slot 1 for lesson completion
* Commands the agent to collect all nearby blocks and items
*/
//% block = "collect all"
//% weight = 95
export function collectAndCount() {
let SLOT_NUMBER = 1
let TOTAL_PIECES = 29
agent.collectAll()
if (agent.getItemCount(SLOT_NUMBER) == TOTAL_PIECES) {
if (agent.getItemCount(SLOT_NUMBER) >= TOTAL_PIECES) {
blocks.place(REDSTONE_TORCH, world(-143, 31, 59))
}
}
Expand Down

0 comments on commit 0d5451e

Please sign in to comment.