低調の美國生活

各種疑難雜症

Game Center Multiplayer 的設置與遊戲實際應用範例

 

iOS Game Center Multiplayer

CONTENT

  • 基本觀念
  • Initialize & Coding Tips
  • Device Setting Check
  • Testing Result
  • Also Need To Know…
  • 實用範例 (ToDo)

 

基本觀念

  • 知道哪些Message要Send/Receive
  • 知道哪些是Critical Message 哪些不是
    • Critical Message 就是必須確定對方一定有收到後才能繼續下一步的那種message,如Game Over / Game Reset

INITIALIZE & CODING TIPS

  • Ask player to log in Game Center when launching the game (authenticateLocalPlayer)
  • Matching Friends (Send & Accept Invite)
  • Do not forget to add EventListener
  • Load the Game
  • If you have two players only, then set to TWO users maximum only (otherwise it will wait forever in matching for the rest of 2 users) (GameCenterMultiplayerBinding.showMatchmakerWithMinMaxPlayers22 ))

DEVICE SETTING CHECK

  • Activate Sandbox mode (Settings / Game Center / Sandbox)

TESTING RESULT

  • iPod5 to iPhone4S: can not the invite message >needs to go notification panel and click and wait couple seconds
  • -iPod5 to iPod5: ok
  • -iPad to iPod5: Ok

ALSO NEEDS TO KNOW

Lists & Dictionaries

  • Both work similar ways to arrays
  • Lists is a Class
  • List a dynamically array: You don’t need to know how many elements in it

Delegate & Events


ToDo

  • Send & Receive
  • Get Player’s Name (Alias)
  • Get Player’s Photo
  • 戰績 Rankings

 


發佈於 2月7日2015年