用SpriteKit 做遊戲

用SpriteKit 做遊戲

3f7d9611fc919c98512b779cde637dfc?s=128

Johnlin

May 22, 2017
Tweet

Transcript

  1. ༻SpriteKit ၏༡ፍ John Lin @johnlinvc

  2. ॄኄੋSpriteKit • iOS ্༻ိ၏༡ፍతܥ౷ɻ • แؚ៸ᅷ࿨෺ཧҾ№ɻ • ՄҎշ଎஍၏ग़༡ፍɻ

  3. ၏Ұݸ䤫଍ٿతখ༡ፍ

  4. ݩ݅෼ੳ • Ұݸ SpriteKit ሢҊ • Ұᰒٿ • ᴍٿత࣌ީཁ೺ٿԟ্䤫 •

    㑌䤫ҰԼཁՃҰ෼ • ٿམ஍෼Ꮠཁᓤྵ
  5. ։Ұݸ SpriteKit ሢҊ • બ File -> New -> Project

    • બ Game, ҈ԼҰ㑊
  6. i બ㟬ࣗݾతୂޔ রଧ ෆॏཁ ෆॏཁ ෆॏཁ Swift SpriteKit iPhone ࡾݸ౎ෆཁޯ

  7. ։Ұݸ SpriteKit ሢҊ • બ File -> New -> Project

    • બ Game, ҈ԼҰ㑊 • ௐ੔ઃఆ • બଘ䈕Ґஔ
  8. ௚઀ࣥߦ • ။؃౸ҰࠣᏈՌత Demo • ෆӨڹɼզ၇बઌཹஶଞ

  9. ՃೖҰᰒٿ • ։⬏GameScene.sks • ӈԼํፙ౸Label Nodeɼ䇪౸ᙘ໘্ • ೺ Name ઃ੒

    ball • edit -> Emoji & Symbols ፙ౸଍ٿɼ೺Text ׵੒଍ٿ • Font ೺ࣈᱪେখௐ੒150 • Vertical Alignment ௐ੒ Center
  10. None
  11. None
  12. څٿ෺ཧઃఆ • ଧ։ GameScene.swift • Ճೖ ball ᏓᏐ • څ

    ball ෺ཧઃఆ
  13. Ճೖ ball ᏓᏐ

  14. څ Ball ෺ཧઃఆ

  15. ์Ұմ஍൘ • ࡏGameScene.sks ཫ໘ՃҰݸ஍൘ • ࡏ GameScene.swift ཫઃఆ஍൘త෺ཧಛੑ

  16. ࡏGameScene.sks ཫ໘ՃҰݸ ஍൘ • ଧ։ GameScene.sks • ኺӈԼ֯䇪Ұݸ Shape Node

    ਐᙘ໘ • څଞҰݸ㟬تᓣత fill color • ઃఆ໊ࣈҝ ground • ೺ scale X ઃ੒ 8, ์౸ᦊນԼ㐊
  17. None
  18. ࡏ GameScene.swift ཫઃఆ஍൘ త෺ཧಛੑ

  19. 䤫ٿ • ᙛᴍ౸ٿత࣌ީɼڅٿҰݸ޲্తিྔ • ᙘ໘ඃᴍ౸త࣌ީ။ݺڣ GameScene.swift ཫత touchesBegan • ᒾҰ༗ᔒ༗ᴍ౸ٿɼ༗ᴍ౸త࿩बڅሏিྔ

  20. څٿিྔ

  21. ܭ෼ • ⃧ՃҰݸ score ᏓᏐ • 㑌ᴍ౸Ұ࣍बՃҰ෼ • ೺෼Ꮠᰖࣔࡏ label

  22. ⃧ՃҰݸ score ᏓᏐ

  23. 㑌ᴍ౸Ұ࣍बՃҰ෼

  24. ೺෼Ꮠᰖࣔࡏ label ্

  25. ॏ৽ܭ෼ • ᙛٿᎃ౸஍্త࣌ީ෼Ꮠጯ֘ཁॏ৽ܭࢉ • ઃఆٿ࿨஍൘઀ᨀ࣌ཁ௨஌զ၇ • ᙛ઀ᨀత࣌ީ೺෼Ꮠᓤ0, ࣕ׌ᰖࣔ෼Ꮠ

  26. ઃఆٿ࿨஍൘઀ᨀ࣌ཁ௨஌զ ၇

  27. ᙛ઀ᨀత࣌ީ೺෼Ꮠᓤ0, ࣕ׌ᰖ ࣔ෼Ꮠ

  28. ਐ֊୊ • ᰖࣔ࠷ߴ෼ه㑚 • ґরᴍ㐝Ґஔိܾఆ䤫ٿతํ޲ • मվ䤫ٿ࣌తಛᏈ

  29. Q&A