cross platform mobile game development

Post on 08-May-2015

614 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Developing games with Cocos2d-x

TRANSCRIPT

Cross Platform Mobile Game Development

Saturday, August 24, 13

About Me• Allan Davis

• http://www.cajuncode.com

• Email: Cajun.code@gmail.com

• Twitter: @cajun_code

Saturday, August 24, 13

Agenda

Saturday, August 24, 13

Tools• Graphics

• Bitmap: Gimp, Photoshop, Pixelmator

• Vector: Inkscape, iDraw

• 3D: Blender, 3D Studio Max

• Other: TexturePacker

• Audio

• Audacity: http://audacity.sourceforge.net/

• Musescore: http://musescore.org

• Frameworks

Saturday, August 24, 13

Mobile Game Frameworks Landscape

• Corona

• Unity

• Cocos2d-X

• Many others ...

Saturday, August 24, 13

Corona

• 2d Game Framework

• iOS, Android

• Lua

• Closed Source

• Free to use Starter version

• Does allow publishing

• http://coronalabs.com

Saturday, August 24, 13

Unity 3d

• 3d Environment for creating games

• Desktop, iOS, Android Blackberry

• C#, Javascript or Boo Script

• Closed Source

• Free to develop and publish

• http://unity3d.com/

Saturday, August 24, 13

Cocos2d-x

• 2D Game Framework

• iOS, Android, Windows Phone, Desktop

• Open Sourced

• C++ 11 (3.0 alpha)

• www.cocos2d-x.org

Saturday, August 24, 13

Demo: Getting Started

Saturday, August 24, 13

Game loop

Setup Game

Get User Input

Update Game

Objects

Update Display

Done?Shut

DownYes

No

Saturday, August 24, 13

Director

Class that creates and handle the main Window and manages how and when to execute the Scenes.

The Director is also responsible for:• initializing the OpenGL context• setting the OpenGL pixel format (default on is RGB565)• setting the OpenGL buffer depth (default one is 0-bit)• setting the projection (default one is 3D)• setting the orientation (default one is Portrait)

Saturday, August 24, 13

NodeAnything that gets drawn or contains things that get drawn is a Node. The most popular Nodes are: Scene, Layer, Sprite, Menu.

The main features of a Node are:• They can contain other Node nodes (addChild,

getChildByTag, removeChild, etc)• They can schedule periodic callback (schedule,

unschedule, etc)• They can execute actions (runAction, stopAction,

etc)

Saturday, August 24, 13

Sprite

Saturday, August 24, 13

SpriteSprite is a 2d image ( http://en.wikipedia.org/wiki/Sprite_(computer_graphics) )Sprite can be created with an image, or with a sub-rectangle of an image.If the parent or any of its ancestors is a SpriteBatchNode then the following features/limitations are valid• Features when the parent is a BatchNode:◦ MUCH faster rendering, specially if the SpriteBatchNode has many children.

All the children will be drawn in a single batch.• Limitations◦ Camera is not supported yet (eg: OrbitCamera action doesn't work)◦ GridBase actions are not supported (eg: Lens, Ripple, Twirl)◦ The Alias/Antialias property belongs to SpriteBatchNode, so you can't

individually set the aliased property.◦ The Blending function property belongs to SpriteBatchNode, so you can't

individually set the blending function property.◦ Parallax scroller is not supported, but can be simulated with a "proxy" sprite.

Saturday, August 24, 13

Sprite Batch NodeSpriteBatchNode is like a batch node: if it contains children, it will draw them in 1 single OpenGL call (often known as "batch draw").A SpriteBatchNode can reference one and only one texture (one image file, one texture atlas). Only the Sprites that are contained in that texture can be added to the SpriteBatchNode. All Sprites added to a SpriteBatchNode are drawn in one OpenGL ES draw call. If the Sprites are not added to a SpriteBatchNode then an OpenGL ES draw call will be needed for each one, which is less efficient.Limitations:• The only object that is accepted as child (or grandchild, grand-grandchild, etc...) is Sprite or

any subclass of Sprite. eg: particles, labels and layer can't be added to a SpriteBatchNode.• Either all its children are Aliased or Antialiased. It can't be a mix. This is because "alias" is a

property of the texture, and all the sprites share the same texture.

Saturday, August 24, 13

Action

Saturday, August 24, 13

Demo:FTL Effect: Invasion

Saturday, August 24, 13

Resources

• Webiste:

• http://www.cocos2d-x.org/

• Tutorials:

• http://www.raywenderlich.com/tutorials

• Book:

• http://www.packtpub.com/cocos2d-x-by-

Saturday, August 24, 13

Questions?

Saturday, August 24, 13

top related