Teacher's Guide

Chapter 1 / Level 6: Building objects

Teaching Objective:

  • Student understands how collecting items interact with objectives
  • Learn how to use the build() function
  • Learn how to properly navigate multiple objectives in a map

Guide

Collect logs and head to the X mark, use the build() function to build a bridge by writing “bridge” inside the function’s parenthesis. To build a bridge you must collect at least 4 logs.

player.build("bridge")

You need to make sure you’re facing the direction you wish to build, depending on where bridge is to be set up it will be spawned horizontally or vertically. You can use functions turn_left() and turn_right() to rotate the character left or right to position your character to face the gap where the bridge is to be built.

player.turn_left()
player.turn_right()

Build the bridge and reach the star to finish the level.

Map overview and path

Map overview and path

Code Solution

import player

player.turn_left()
player.move_forward(3)
player.turn_right()
player.move_forward(5)
player.turn_left()
player.move_forward(4)
player.turn_left()
player.move_forward(3)
player.turn_right()
player.move_forward()
player.build("bridge")
player.move_forward(4)
Chapter 1 / Level 6: Building objects | Teacher's Guide