浮島 ? ?構(gòu)建循環(huán) ?你自己的關(guān)卡

let greenPortal = Portal(color: #colorLiteral(red: 0.4028071761, green: 0.7315050364, blue: 0.2071235478, alpha: 1))


world.place (greenPortal, atStartColumn:

? ? ? ? ? ? ? ?

? ? ? ? ? ? ? ? 1,

? ? ? ? ? ?

? ? ? ? ? ? startRow: 7,atEndColumn: 1, endRow: 1)

let A = Portal(color: #colorLiteral(red: 0.8043354153633118, green: 0.018336141481995583, blue: 6.016343689907444e-08, alpha: 1.0))


world.place (A, atStartColumn:

? ? ? ? ? ? ? ?

? ? ? ? ? ? ? ? 2,

? ? ? ? ? ?

? ? ? ? ? ? startRow: 2,atEndColumn: 5, endRow: 4)

greenPortal.isActive = true

A.isActive = true

let expert = Character()

world.place(expert, facing: .north, atColumn: 1, row: 6)

let block9: Block = Block()

world.place(block9,

? ? ? ? ? ? atColumn: 1, row: 6)


let block8: Block = Block()

world.place(block8,

? ? ? ? ? ? atColumn: 5, row: 4)

let block7: Block = Block()

world.place(block7,

? ? ? ? ? ? atColumn: 6, row: 3)

let block6: Block = Block()

world.place(block6,

? ? ? ? ? ? atColumn: 2, row: 2)

let block5: Block = Block()

world.place(block5,

? ? ? ? ? ? atColumn: 1, row: 1)

for i in 1 ... 2 {

? ? let qc = Stair()

? ? world.place (qc,facing: .north, atColumn:2,row: 6)

? ? let qa = Stair()

? ? world.place (qa,facing: .north, atColumn:1,row: 6)

? ? let qb = Stair()

? ? world.place (qb,facing: .north, atColumn:1,row: 7)

}

func QQ() {

? ? if expert.isOnClosedSwitch {

? ? ? ? expert.toggleSwitch()

? ? ? ?

? ? } else if expert.isOnGem {

? ? ? ? expert.collectGem()

? ? }

}


for i in 1 ... 3 {

? ?

? ? for i in 1 ... 3 {

? ? ? ?

? ? ? ? for i in 1 ... 3 {

? ? ? ? ? ? if !expert.isBlocked {

? ? ? ? ? ? ? ? expert.moveForward()

? ? ? ? ? ? } else if? !expert.isBlockedRight {

? ? ? ? ? ? ? ? expert.turnRight()

? ? ? ? ? ? ? ?

? ? ? ? ? ? } else if !expert.isBlockedLeft {

? ? ? ? ? ? ? ? expert.turnLeft()

? ? ? ? ? ? ? ?

? ? ? ? ? ? }else if expert.isBlocked {

? ? ? ? ? ? ? ? expert.turnLeft()

? ? ? ? ? ? ? ? expert.turnLeft()

? ? ? ? ? ? }

? ? ? ? ? ?

? ? ? ? ? ? QQ()

? ? ? ? ? ?

? ? ? ? }

}

? ?

? ?

? ?

}

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。
禁止轉(zhuǎn)載,如需轉(zhuǎn)載請通過簡信或評論聯(lián)系作者。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容