SlideShare una empresa de Scribd logo
1 de 32
Cocos2D: An introduction
Rob Caporetto (@rob_caporetto)
www.rob-caporetto.com
Caveats
What is Cocos2D?
Getting Up & Running
Installing


 Visit the Cocos Page &
 download
 Run the installer to
 install the Xcode
 Templates
Installing


 Visit the Cocos Page &
 download
 Run the installer to
 install the Xcode
 Templates
Concepts
Scenes, Layers, Nodes


Scenes
 Conceptually a View Controller
 Managed by the CCDirector
Scenes, Layers, Nodes


Layers
  Logical Separation of elements in the scene
Scenes, Layers, Nodes


Everything is a CCNode
  Sprites, UI Items.
  Allows for Parent/Child relationships
Input
Touch Input

iOS 3 Style Callbacks
  -ccTouchesBegan:withEvent:
  -ccTouchesMoved:withEvent:
  -ccTouchesEnded:withEvent:
  -ccTouchesCancelled:withEvent:
Enable with isTouchEnabled on Layer
Touch Input


No Gesture Recognizers
Best to dig up that legacy code…
Accelerometer Input


Uses existing UIKit callback
  -accelerometer:didAccelerate:
Enabled via isAccelerometerEnabled property
Gyro Input?


Not out of box :(
BUT, CoreMotion is EASY!
Audio
Audio


CocosDenshion Primary
  Includes SimpleAudioEngine wrapper
Alternate is ObjectAL
SimpleAudioEngine

Obtain SimpleAudioEngine instance
Preload, Play or Unlock
  [audioEngine preloadEffect:filename]
  [audioEngine playEffect:filename]
  [audioEngine unloadEffect:filename]
SimpleAudioEngine (cont)

Obtain SimpleAudioEngine instance
Preload or Play Music
  [audioEngine preloadBackgroundMusic:filename]
  [audioEngine playBackgroundMusic:file loop:YES]
  [audioEngine stopBackgroundMusic:filename]
The Demo Game
Conclusion
Resources (Code)


Cocos2D: http://www.cocos2d-iphone.org/
ShooterDemo: https://github.com/robc/
ShooterDemo
Resources (Tools)


cfxr: http://thirdcog.eu/apps/cfxr
TexturePacker: http://www.texturepacker.com
GlyphDesigner: glyphdesigner.71squared.com
Resources (Books)


Learning Cocos2D: http://cocos2dbook.com/
Learn Cocos2D Game Development*: http://
www.learn-cocos2d.com/store/book-learn-
cocos2d/

Más contenido relacionado

Último

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 

Último (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Cocos2D Introduction (Melbourne Cocoaheads 20111013)

Notas del editor

  1. \n
  2. This is just an INTRO to Cocos2D.\nI’m not going to cover *everything* that it’s capable of (Physics, Tilemaps, etc.), but enough to create something incredibly simple.\nThe goal is to just show how easy it is to get a BASIC 2D game up & running with the engine on iOS.\n
  3. Open Source (Custom License)\n2D Engine (Using GL ES 1.1 / GL 1.5, 2.0 (in alpha) will be moving to GL ES 2.0\niOS/Mac OS X port of Python based engine (using Objective-C) (iOS ~2008, OSX more recently)\n- Follows its design styles, memory patterns (ie. lots of Autoreleased objects).\n\nLarge number of features:\n- Integrated Tilemap, Particle Engine, Menu System\n- Integrates with Box2D & Chipmunk for Physics (Optional)\n\nIncredibly popular engine.\n - A lot of good resources/tools out there (will cover at the end)\n - Easy to add additional functionality (is installed as src into project, and most other addons are done the same way.\n - Extensibility lead to alternate ‘distribution’ Kobold2D\n\n2500+ Games using it on the App Store (at last count).\n\n\n
  4. A few examples out there (a random selection of games I have on my phone)\n\na) Commander Pixman\nb) Trainyard\nc) Infinity Field\nd) League of Evil\ne) Super Shots Golf\n
  5. A few examples out there (a random selection of games I have on my phone)\n\na) Commander Pixman\nb) Trainyard\nc) Infinity Field\nd) League of Evil\ne) Super Shots Golf\n
  6. A few examples out there (a random selection of games I have on my phone)\n\na) Commander Pixman\nb) Trainyard\nc) Infinity Field\nd) League of Evil\ne) Super Shots Golf\n
  7. A few examples out there (a random selection of games I have on my phone)\n\na) Commander Pixman\nb) Trainyard\nc) Infinity Field\nd) League of Evil\ne) Super Shots Golf\n
  8. A few examples out there (a random selection of games I have on my phone)\n\na) Commander Pixman\nb) Trainyard\nc) Infinity Field\nd) League of Evil\ne) Super Shots Golf\n
  9. \n
  10. - Visit the website (Link at the end regardless)\n- Download the package (.tar.gz)\n- Unpack, and run the install-templates.sh script.\n- This installs everything for both Xcode 3 (remember that?) and Xcode 4\n- Then you fire up Xcode, create a new project…\n
  11. …BOOM!\n\nHere you get 3 default configurations. A plain Cocos2d project, a Cocos2d project linked to the Box2D physics library, or the Chipmunk physics library.\n\nPlus you also get the same configures applied to building OS X targets.\n\n(All of which are a tad beyond scope on this one).\n
  12. \n
  13. Basic Concept:\n- Graph of Nodes\n- Each graph starts off with a scene: This is just used to anchor everything else\n\nThe Director manages the overall flow of the game (much like UIApplication does for a UIKit app).\n\nThe Director can load or replace a scene, can also push & pop scenes (allowing you to create a pause screen or menu eg).\n
  14. Layers separate out items on the scene.\nEnsures that as you manipulate items in the scene, that others can be left affected.\nExamples - your game’s UI. You don’t want this to move about as your player moves through the world.\n\n
  15. Benefit of a giant node graph is parent/child relationships.\nCould have a RPG where you could attach armour/weapons depending on inventory.\n\n
  16. - Direct support for Touch & Accelerometer Input\n- Includes handling for multitouch\n
  17. - Custom Callbacks on your Layers\n- Allows for focused handling (a bit out of scope)\n- Lets you split touch tracking on different layers (ie. for UI & action)\n\n-\n
  18. No. Gesture. Recognizer. Support.\n- There is an unofficial patch to add it, which I’ve not tried\n- \n
  19. - Again, enabled on a per layer basis.\n- Nothing really special here\n- Need to manually track reference position (ie. Calibration UI - we don’t get anything special here).\n
  20. - There’s no out of box handling for the gyro - unsure why though… just not there!\n- CoreMotion’s easy to set-up though - if you’re happy to keep to iOS 4+.\n- That being said, even with the Gyro you need to track reference points (plus deal with Gimbal Lock issues if you’re not careful).\n- CoreMotionTeapot code from WWDC2010 code is a great starting point for this.\n
  21. \n
  22. - C2D includes “CocosDenshion” - an engine handling both AVFoundation/AudioToolbox & OpenAL.\n- Also includes a SimpleAudioEngine wrapper around that - one line playback (or two with preloading) of music/sound effects\n\n- An alternative is ObjectAL - out of the box there’s a few benefits (easier to do some other things - looping sound effects).\n
  23. Obtain the SharedAudioEngine instance (it’s exposed as a singleton!)\nThen you can preload/play/unload\n\nPreloading ensures the sound is ready to go (so no delay when required)\nUnloading helps to manage memory of course\nPlay performs a single shot.\n\nPlay has a more complex overload - can tweak parameters, allows you to get some dynamic audio in there\n
  24. Obtain the SharedAudioEngine instance (it’s exposed as a singleton!)\nThen you can preload/play\n\nPreloading ensures the sound is ready to go (so no delay when required)\nPlay can play it once, or continually loop until stopped.\n
  25. Time to show this in action.\nFire up the game (via the iPad or the simulator - NB: NO AUDIO ON SIM)\n\nBreak through the codebase.\n- Show how the scenes are set-up\n- Title:\n- How the menu is built & handled\n\n- Game:\n- Layers (background, HUD, gameplay)\n- Show touch input\n- Show audio playback\n\n- General\n- Show Fonts\n- Show Director & Transitions\n- Show Actions\n\n
  26. Just an overview of what Cocos offers.\nI prefer it due to fitting somewhat in line with general iOS semantics.\nThere are other engines (Sparrow, Pixelwave, iTorque, even wrangling Unity into a 2D engine).\n\n
  27. Cocos Homepage - here’s where you can get the source/package of the stable releases (as well as the possible 2.0 alphas & other builds).\n\nAlso has the documentation (including offline versions for Xcode) & some other tutorials (which might be out of date)\n\nAlso the link to the source for the demo game - should be ready to go & build with the latest iOS SDK (Built using the 5.0GM, needs 4.2 to run ‘cause I use lots of blocks!)\n
  28. \n
  29. These are the two major books on using Cocos2D. I prefer the first, but the second is about to get an updated edition covering iOS 5, UIKit, the Cocos3D library\n