Upgrade to Pro — share decks privately, control downloads, hide ads and more …

對戰三平棋

MarkFly
March 20, 2018

 對戰三平棋

SIMPEI小遊戲實作分享 @ iOS Taipei

MarkFly

March 20, 2018
Tweet

More Decks by MarkFly

Other Decks in Programming

Transcript

  1. • 第⼀回合 • 寫死5,6,9,10 • 放⼦、吹⼦ • All You Can

    Place 各階段如何判斷可不可下 showMoveHint
  2. 1. 同⾊同界的棋⼦數⼤於3 1. 同界周圍(x或y相減絕對值為1)是否有同⾊棋(第⼆顆棋) 1. 有第三顆棋(註1) 1. 地獄 1. 贏了

    2. 天堂 1. 沒有第四顆棋(註2) 1. 贏了 如何判斷是否連線 checkLink(currentChess:Chess)
  3. Firebase function 1. Database.database().reference(withPath: ".info/connected") 2. onDisconnectRemoveValue 3. onDisconnectSetValue 4.

    observeSingleEvent 1. childAdded 2. childRemoved 3. childChanged 4. childMoved 5. value 5. observe 6. removeAllObservers 7. childByAutoId 8. child 9. setValue 10. removeValue
  4. 監聽對象 1. 換⼿ 2. 對⼿走⼦ 3. 對⼿夾⼦ 4. 對⼿贏了 5.

    對⼿投降 6. 續戰邀約 7. 建立新比賽