let character = Character()
world.place(character, atColumn: 2, row: 3)
let greenportal = Portal(color: #colorLiteral(red: 0.341176480054855, green: 0.623529434204102, blue: 0.168627455830574, alpha: 1.0))
let pinkportal = Portal(color: #colorLiteral(red: 0.909803926944733, green: 0.47843137383461, blue: 0.643137276172638, alpha: 1.0))
world.place(greenportal, atStartColumn: 1, startRow: 0, atEndColumn: 3, endRow: 6)
world.place(pinkportal, atStartColumn: 0, startRow: 7, atEndColumn: 5, endRow: 5)
func togglrOrCollect() {
if character.isOnGem {
character.collectGem()
} else if character.isOnClosedSwitch {
character.toggleSwitch()
}
}
func jumpTG() {
character.jump()
togglrOrCollect()
}
func turnAround() {
character.turnLeft()
character.turnLeft()
}
for i in 1 ... 2 {
jumpTG()
jumpTG()
character.turnRight()
jumpTG()
character.turnLeft()
character.jump()
character.turnRight()
}
turnAround()
jumpTG()
character.turnLeft()
jumpTG()
character.turnRight()
jumpTG()
youtu.be