let greenPortal = Portal(color: #colorLiteral(red: 0.4028071761, green: 0.7315050364, blue: 0.2071235478, alpha: 1))
world.place (greenPortal, atStartColumn:
1,
startRow: 5,atEndColumn: 5, endRow: 1)
greenPortal.isActive = false
func 宝() {
if isOnGem {
collectGem()
}
}
func 左() {
moveForward()
turnRight()
moveForward()
turnRight()
turnRight()
}
for i in 1 ... 4 {
宝()
左()
}
greenPortal.isActive = true
moveForward()
greenPortal.isActive = false
moveForward()
turnRight()
turnRight()
for i in 1 ... 4 {
宝()
左()
}