Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cross Platform Mobile Game Development

Allan Davis
August 24, 2013
160

Cross Platform Mobile Game Development

Allan Davis

August 24, 2013
Tweet

Transcript

  1. 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
  2. Mobile Game Frameworks Landscape • Corona • Unity • Cocos2d-X

    • Many others ... Saturday, August 24, 13
  3. Corona • 2d Game Framework • iOS, Android • Lua

    • Closed Source • Free to use Starter version • Does allow publishing • http://coronalabs.com Saturday, August 24, 13
  4. 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
  5. 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
  6. Game loop Setup Game Get User Input Update Game Objects

    Update Display Done? Shut Down Yes No Saturday, August 24, 13
  7. 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
  8. Node Anything 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
  9. Scene • Scene an Node are almost identical with the

    difference that Scene has it's anchor point (by default) at the center of the screen. Saturday, August 24, 13
  10. Layers Layer is a subclass of Node that implements the

    TouchEventsDelegate protocol. All features from Node are valid, plus the following new features: • It can receive iPhone Touches • It can receive Accelerometer input Saturday, August 24, 13
  11. Sprite Sprite 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
  12. Sprite Batch Node SpriteBatchNode 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