cocos2d programming
DESCRIPTION
Cocos2d Game Programming technology for developers.Basic tutorial for Cocos2d on CMU MSIT course.TRANSCRIPT
![Page 1: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/1.jpg)
Cocos2D Programming
Dong Gyu PARK ( [email protected] )June. 2012.
Carnegie Mellon University - MSIT
![Page 2: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/2.jpg)
Introduction
• DongGyu PARK(Dennis PARK)
• Associate Professor
• Changwon National University, S. KOREA
• Visiting Scholar at TAMU(2012. Feb-.)
• Visiting Researcher at CMU(2007-2008), Pittsburgh, PA
• Blog http://Cocos2dDev.com/ (Korean)
![Page 3: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/3.jpg)
Agenda
• Portfolios
• Mobile Games
• Cocos2d Introduction
• Learning Cocos2d
• Cocos2d Tools
• Cocos2d on iOS vs Android
![Page 4: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/4.jpg)
Portfolios
![Page 5: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/5.jpg)
Shake Series
• Shaking App using accelerometer sensor
• 4 Players can play
• Fun Sounds
• Lightweight App
• Game Center available
• Cocos2d game development kit
![Page 6: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/6.jpg)
Shake Series
![Page 7: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/7.jpg)
Coke Shake
http://itunes.apple.com/us/app/coke-shake!/id448242537?mt=8
![Page 8: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/8.jpg)
Action Game
![Page 9: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/9.jpg)
Monster Buster
![Page 10: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/10.jpg)
Monster Buster
http://itunes.apple.com/us/app/monster-buster/id440886409?l=ko&ls=1&mt=8
![Page 11: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/11.jpg)
Pocket Windmill
http://itunes.apple.com/us/app/pocket-windmill/id439495371?l=ko&ls=1&mt=8
![Page 12: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/12.jpg)
Mobile Games
![Page 13: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/13.jpg)
Successful Mobile Game
![Page 14: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/14.jpg)
Successful Mobile Game
• The game has to be easy to learn and understand
• people to not spend much time to learn mobile games
• Little input, Big output
• Simple but huge amount of feedbacks
• Physics based gameplay
• physics give much variations on same input
![Page 15: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/15.jpg)
Successful Mobile Game
• A bright, fun, cartoony, and cute visual style
• Very simple storyline
• The player is constantly rewarded
• Huge amount of levels but very short to play
• Provides users ranking
![Page 16: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/16.jpg)
AR Game : AR Defender
http://www.youtube.com/watch?v=rB5xUStsUs4&feature=player_embedded
AR defense - tracking by camera and marker
![Page 17: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/17.jpg)
Look-up
http://www.youtube.com/watch?v=bps3FkX-_cY&feature=player_embedded
Team play is available
![Page 18: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/18.jpg)
Cocos2D Introduction
![Page 19: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/19.jpg)
Cocos2d
• Open Source 2D Game Framework
• Built upon the OpenGL API’s
• 2D Game, Graphic, Interactive Application Programs
• Sep. 2008 - 0.3.0 version released
• Used in thousands of apps
• Active developer community
![Page 20: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/20.jpg)
Cocos2d
• Multi-platform game engine
• iOS, Mac OS X, Android ported
• Started as a Python framework, re-written in Objective-C in 2008
• Cocos2d-x - multi-platform port written in C++
![Page 21: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/21.jpg)
Trainyard: #2 Paid
ZombieSmash: #1 PaidAir Penguin: #1 Paid
Birzzle
Cocos2d games
![Page 22: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/22.jpg)
Cocos2d vs OpenGL
• You can also make a high level game using openGL, but ...
• You will need an animation of sprits, menus for the game, actions for game objects, sound effects, and much more...
• Cocos2d supports a wrapper class of OpenGL
• Also sound control class, menu class, sprites...
![Page 23: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/23.jpg)
and CoreGraphics
• C-based API based on Quartz drawing engine
• low-level, lightweight 2D rendering
• path-based drawing, transformation, color management, offscreen rendering, patterns, image data management, image creation, masking
• low-level drawing apps
![Page 24: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/24.jpg)
Cocos2d
http://www.cocos2d-iphone.org/
![Page 25: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/25.jpg)
Installation for iOS
![Page 26: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/26.jpg)
Installation for iOS
![Page 27: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/27.jpg)
Installation(super easy)
![Page 28: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/28.jpg)
Cocos2d for Android
http://code.google.com/p/cocos2d-android-1/
![Page 29: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/29.jpg)
Sample Program
Many featured sample codes are provided
![Page 30: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/30.jpg)
Cocos2D Package
Tutorial codes for beginners- easy to start
![Page 31: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/31.jpg)
Tutorial
![Page 32: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/32.jpg)
Demo
Cocos2D for iPhone
![Page 33: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/33.jpg)
and More
![Page 34: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/34.jpg)
Learning Cocos2d
![Page 35: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/35.jpg)
Features
• Scene Graph Structure
• Flow Control(Scene Management)
• Flow Control between Scenes
• Sprites and Sprite Sheets
• Easy and powerful way of Sprite Usage
• Actions are most powerful features
• Supports many actions including move, rotate, scale, sequence, spawn, and manipulate objects with ease.
![Page 36: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/36.jpg)
Features
• Various 2D effect including wave, twirl, lens, liquid, ripple
• Tiled Maps, Transition, Menus, Text Rendering
• Built-in Font Support
• Embedded TrueType fonts and bitmap font
• Physics Engine : Chipmunk, Box2d, Particle System
![Page 37: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/37.jpg)
Features
• Basic Menu and Button
• Parallax scrolling
• Sound Controls, Particle System
• High Score server(Cocos live)
• Based on OpenGL ES 1.1 - for iOS
• Based on OpenGL 1.5 - for Mac
![Page 38: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/38.jpg)
Scene Graph Structure
• General data structure used in Vector based graphics editing application or games.
• Acrobat 3D, AutoCAD, VRML, Open Inventor, X3D, OpenSG,..
• Collection of nodes in a graph or tree structure
![Page 39: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/39.jpg)
Scene Graph
• Hierarchy of every Cocos2d NODE that's currently active.
• Every node has exactly one parent node, except the scene itself, and can have any number of child nodes.
• General technique on high level graphics system or game programming
![Page 40: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/40.jpg)
Scene GraphCCScene
CCLayer CCLayer CCLayer
CCSprite CCMenu CCSprite
![Page 41: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/41.jpg)
Principal Classes• Cocos2D Class has name space starting with
CC-.
• CCNode - main class
• CCDirector - controls scenes
• CCSprite - logic to hold and manipulate game image
• CCScene
• CCLayer
![Page 42: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/42.jpg)
CCNode Class
• The CCNode class is the super class of all Cocos2d class
• Defines common attributes and methods that all Cocos2d object must have
• contains the logic to enable it to schedule events on itself as well as to perform Cocos2d actions
![Page 43: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/43.jpg)
CCNode Class
• Most important Cocos2D class, most object in Cocos2d inherits from CCNode
• CCScene, CCLayer, CCSprite, CCMenu classes are children of CCNode class
• Can include another CCNode object.
• Can schedule periodic callbacks
• Can run all actions
![Page 44: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/44.jpg)
CCNode Class
• Attributes
• rotation, scaleX_, scaleY_,position, visible_, anchorPointInPixels_, anchorPoint_, isRelativeAnchorPoint_, contentSize_, transform_, inverse_, vertexZ_, camera_, grid, zOrder_, children_, ...
![Page 45: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/45.jpg)
rotation
posit
ion
anchorPoint
• If you want to draw a monster in your game scene• You will need an image( CCSprite )• And its position, size, rotation angle, anchor point, ...(Attributes)
CCNode : Attributes
![Page 46: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/46.jpg)
CCDirector Class
• Similar to a director’s role in movies
• Management object for game control thru scene
• OpenGL ES environment setting
• Running the game loop
![Page 47: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/47.jpg)
CCScene Class
• A game is composed of multiple screens
• Each scene compose each screen on game
• Scene is composed of multiple layers (hierarchical structure)
• Scene contains CCLayer and other graphical objects on screen
![Page 48: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/48.jpg)
Scene & Director
CCDirector
CCScene CCScene CCScene..
..
![Page 49: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/49.jpg)
CCScene ClassCCScene
CCLayer CCLayer
(game layer) (touch handling layer)
![Page 50: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/50.jpg)
CCLayer Class
• One Game scene can contain many layers
• and each layer contains more than one sprite or menu
• Capture user interaction or accelerometer
• Layer consists a scene
![Page 51: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/51.jpg)
CCLayerScore: 210 LIFE : 3
CCLayer
CCSprite CCLabel CCNode..
CCSprite CCSprite ..
..
![Page 52: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/52.jpg)
CCLayerScore: 210 LIFE : 3
CCLayer
CCSprite CCLabel CCNode..
CCSprite CCSprite ..
.. remove child
![Page 53: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/53.jpg)
• CCLayer can handle touch and accelerometer events
• all the sprites and game elements are contained within layers
• Game controller
• Manage game entities
CCLayer Class
![Page 54: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/54.jpg)
Sprite Object
• Image files are loaded into OpenGL ES Textures in a format that the GPU can understand
• contains the necessary logic to hold and manipulate your image.
• Sprites may be animated, by cycling through a number of different images
![Page 55: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/55.jpg)
CCSprite
Texture-Sprite Sheet
Sprites
![Page 56: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/56.jpg)
Action
• Control the movement, transition, and effects of Cocos2d objects.
• All CCNode objects are able to run actions.
• CCAnimate, CCJumpBy, CCRepeatForever, CCSequence, CCSpawn, CCMoveTo, CCFadeTo,...
![Page 57: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/57.jpg)
• Modify node’s attributes by time
• position/rotation/scale/opacity/grid/...
• Interval actions and Instant actions
• Actions that let you compose actions
• Sequence action, Spawn action, Repeat action, RepeatForever action
Action
![Page 58: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/58.jpg)
Running an Action
![Page 59: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/59.jpg)
Running an Action
high level action description
![Page 60: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/60.jpg)
Tools - TexturePacker
• Loading a sprite requires much system resources
• In a game scene many sprites are required
• each sprite contains many animation images
• packaging each image into a big sprite sheet
![Page 61: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/61.jpg)
Sprite Images
...
MB_01.png MB_02.png MB_03.png MB_03.png
![Page 62: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/62.jpg)
Making a big Sprite Sheet
![Page 63: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/63.jpg)
Meta data
![Page 64: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/64.jpg)
in your codeSprite sheet file
Sprite file
Sprite frame from sprite cached sheet
Animation contain frames
Animate framesrepeats animation forever
![Page 65: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/65.jpg)
in your code
![Page 66: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/66.jpg)
Tutorial-Birds on Wire
http://itunes.apple.com/us/app/birds-on-a-wire/id474403193?mt=8
![Page 67: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/67.jpg)
How to use
...
...
![Page 68: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/68.jpg)
Cocos2d Tools
![Page 69: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/69.jpg)
Tools-Font Generator
• Many game developers want in-house bitmap font
• Game scene needs an special font effect and customized fonts
![Page 70: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/70.jpg)
Font Generator
http://www.bmglyph.com/http://www.71squared.com/
![Page 71: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/71.jpg)
in your code
font file(testFont.png)
import meta-data(testFont.fnt)
![Page 72: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/72.jpg)
Sound Editor• Sound Effect is very important in a game
![Page 73: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/73.jpg)
Sound in your code• SimpleAudioEngine
object is a wrapper to the CDAudioManager object
• if you just want to play some sound fx without knowing lower level working, this is the interface to use
![Page 75: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/75.jpg)
Particle Editor
http://particledesigner.71squared.com/
![Page 76: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/76.jpg)
More game tools
http://www.learn-cocos2d.com/2011/06/complete-list-cocos2d-tools/
![Page 77: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/77.jpg)
Game Tools
• Many 3rd party game tools for Cocos2d are available
• Enrich your game effect
• Minimize your programming efforts
• More efficient way of memory management
![Page 78: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/78.jpg)
Cocos2d on iOS vs Android
![Page 79: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/79.jpg)
Cocos2d-android
• based on cocos2d-iphone design
• uses same API, but instead of using objective-c, it uses Java
• comparing to iOS design, it goes slow updating(latest follow-up cocos2d-iphone version is 0.99.4-June, 2012)
![Page 80: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/80.jpg)
Android Code
http://dan.clarke.name/2011/04/how-to-make-a-simple-android-game-with-cocos2d/
![Page 81: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/81.jpg)
iOS code
http://www.raywenderlich.com/352/how-to-make-a-simple-iphone-game-with-cocos2d-tutorial
![Page 82: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/82.jpg)
Android
![Page 83: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/83.jpg)
Android code
![Page 84: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/84.jpg)
iOS
![Page 85: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/85.jpg)
iOS code
![Page 86: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/86.jpg)
Android iOS
![Page 87: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/87.jpg)
Demo
![Page 88: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/88.jpg)
Cocos2d-X
• Cocos2d-X is a port of Cocos2d engine using C++
• written in C++ and OpenGL ES 1.1/2.0
• run on iOS, Android, BlackBerry, Bada(Samsung phone), Marmalade, Windows, Linux and more
![Page 89: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/89.jpg)
Cocos2d-html5• written in Javascript for
HTML5 compliant browser
• derived from Cocos2d-X
• Available Cocos2d game on your web browser
http://www.gamefromscratch.com/post/2012/06/03/Cocos2D-HTML-release-a-tech-demo-Moon-Warriors.aspx
![Page 90: Cocos2d programming](https://reader035.vdocuments.us/reader035/viewer/2022062418/554bd75ab4c905706a8b51d9/html5/thumbnails/90.jpg)
Q & A