iOS Game Development: When Cocoa Met Cocos...
-
Upload
joseph-ku -
Category
Technology
-
view
3.414 -
download
1
description
Transcript of iOS Game Development: When Cocoa Met Cocos...
![Page 2: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/2.jpg)
Outline
Where to start?...
Let Apple help you!
Piece of cake?
Game engines for iOS?
What’s cocos2d?
Why cocos2d?
Game design concepts
Elements of cocos2d
Last but not least...
References
v1.0.2Build 201105100800
![Page 3: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/3.jpg)
Who am I?
Joseph Ku (Chieh-Fang Ku)(@josephku)
I started to learn programming since 1990, because I wanted to be a game programmer.
A video gamer since 1985
A Linux user since 1996
Ruby lover and Guitar Hero rocker
![Page 4: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/4.jpg)
Who am I?
Game development history
1989: My first board game - 天地を喰らう (not published)
1991: My first RPG game - The Legend of Love (not for public)
All written in x86 Assembly language
1992: Audio card driver of Rich 2
(...Time flies......)
To be continue...
![Page 5: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/5.jpg)
Who am I?
Game development history
2003: Former contributor of Crystal Space (3D game engine)
2004: Experimental 3D game engine - JBOX
(...Time flies again......)
2010: My second board game - 5 Elements (Ready to sell)
Nobody bird me...... Orz
![Page 6: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/6.jpg)
Before we start...
Don’t take any notes. This slide will be published with CC BY-NC-ND.
You could interrupt me anytime.
![Page 7: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/7.jpg)
Before we start...
Layers of iOS
Cocoa Touch
Media
Core Services
Core OS
![Page 8: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/8.jpg)
Before we start...
iOS SDK
XCode Tools
XCode
Interface Builder
Instruments
iOS Simulator
iOS Developer Library
![Page 9: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/9.jpg)
Before we start...
480x320
iPhone, iPhone 3G, iPhone 3GS, iPod Touch
960x640 (Retina Display)
iPhone 4, iPod Touch 4G
1024x768
iPad, iPad2
![Page 10: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/10.jpg)
Let Apple help you!
Game Kit
![Page 11: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/11.jpg)
Let Apple help you!
OpenGL ES 2.0
UIKit
Core Animation
AV Foundation Framework
Accelerometer
HTTP
![Page 12: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/12.jpg)
Let Apple help you!
In-App Purchase
iAds
Airplay
![Page 13: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/13.jpg)
Piece of cake?
It’s is not as easy as you thought!
Better than developing games on PS2
PS2: CPU 294.912MHz, RAM 32MB
iPhone: 800 MHz, RAM 512MB
Multiple function device
![Page 14: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/14.jpg)
Babe, you are not alone
Backgrounded
Phone call
Home button pressed
SMS message
etc.
![Page 15: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/15.jpg)
Endless tuning
One second is a long time
Load the assets you need interactively with the player
Optimize loading times
Playing again and again and again
![Page 16: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/16.jpg)
Game Engines for iOS
iTorque 2D
Full source. No royalties. One price.
$99
Corona
Free as a trial
$199/year
![Page 17: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/17.jpg)
Game Engines for iOS
Unity
Professional 3D game engine
$400
SIO2 Engine
3D game engine
$499.99. Including source code.
![Page 18: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/18.jpg)
Cocos2d
![Page 19: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/19.jpg)
What’s cocos2d?
Accurate name: cocos2d for iPhone
Based on Cocos2d which was written in Python
Written in Objective-C
App Store approved
More than 2500 games use it
![Page 20: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/20.jpg)
Why cocos2d?
Free.
Open source game engine
MIT license
Integrated with Box2D and Chipmunk
Supports Retina Display
Integrated Pause/Resume
![Page 21: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/21.jpg)
Game design concepts
Graphics
Audio
Input
(AI)
![Page 22: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/22.jpg)
Game design concepts
Render Frame -> Game Sim -> User Input
Render Frame -> User Input -> Game Sim
CADisplayLink -> Render Frame -> User Input -> Game Sim
![Page 23: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/23.jpg)
Game design concepts
Flow
![Page 24: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/24.jpg)
Elements of cocos2d
CCDirector
Draw & Update
Scene & Layer
CCNode
CCSprite
CCAction
![Page 25: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/25.jpg)
Elements of cocos2d
![Page 26: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/26.jpg)
Last but not least...
External display support
New UIScreen
“View Programming Guide for iOS”
Windows -> Displaying Content on an External Display
Added on 2011-03-08
![Page 27: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/27.jpg)
Demo
![Page 28: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/28.jpg)
Demo
![Page 29: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/29.jpg)
Last but not least...
Keep watching on AirPlay APIs
How about writing a game for Mac App Store?
Be a real game developer
Game Programming Gems series
Game Developer Magazine
![Page 30: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/30.jpg)
References
iTorque2D
http://www.garagegames.com/products/torque-2d/iphone
Corona
http://www.anscamobile.com/corona/
Unity
http://unity3d.com/
![Page 31: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/31.jpg)
References
Shadow Era
http://www.shadowera.com/
SIO2 Engine
http://sio2interactive.com/
Cocoa2D for iPhone
http://www.cocos2d-iphone.org/
![Page 32: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/32.jpg)
References
Game Kit Programming Guide
http://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/GameKit_Guide/
View Programming Guide for iOS
http://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/
![Page 33: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/33.jpg)
References
Game Programming Gems
http://www.gameprogramminggems.com/
Game Developer Magazine
http://www.gdmag.com/
![Page 34: iOS Game Development: When Cocoa Met Cocos...](https://reader038.fdocuments.in/reader038/viewer/2022102804/54b4815a4a7959ae188b45f1/html5/thumbnails/34.jpg)
Any questions?