Marmalade SDK Mobile Game Development Essentials


Marmalade SDK Mobile Game Development Essentials
eBook: $29.99
Formats: PDF, PacktLib, ePub and Mobi formats
$25.49
save 15%!
Print + free eBook + free PacktLib access to the book: $79.98    Print cover: $49.99
$49.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters
  • Easy to follow with lots of tips, examples and diagrams, including a full game project that grows with each chapter
  • Build video games for all popular mobile platforms, from a single codebase, using your existing C++ coding knowledge
  • Master 2D and 3D graphics techniques, including animation of 3D models, to make great looking games

Book Details

Language : English
Paperback : 318 pages [ 235mm x 191mm ]
Release Date : November 2012
ISBN : 1849693366
ISBN 13 : 9781849693363
Author(s) : Sean Scaplehorn
Topics and Technologies : All Books, Game Development, Mobile, Games

Table of Contents

Preface
Chapter 1: Getting Started with Marmalade
Chapter 2: Resource Management and 2D Graphics Rendering
Chapter 3: User Input
Chapter 4: 3D Graphics Rendering
Chapter 5: Animating 3D Graphics
Chapter 6: Implementing Fonts, User Interfaces, and Localization
Chapter 7: Adding Sound and Video
Chapter 8: Supporting a Wide Range of Devices
Chapter 9: Adding Social Media and Other Online Services
Chapter 10: Extending Marmalade with the Extensions Development Kit (EDK)
Index
  • Chapter 1: Getting Started with Marmalade
    • Installing the Marmalade SDK
      • Installing a development environment
      • Choosing your Marmalade license type
      • Downloading and installing Marmalade
      • Using the Marmalade Configuration Utility
      • Managing your Marmalade account and licenses
        • Viewing an overview of your account
        • Updating your profile information
        • Managing your licenses
        • Managing your user list
    • Creating a Marmalade project
      • Creating the "Hello World" project
        • The MKB file for the "Hello World" project
        • The source file for the "Hello World" project
      • Building the "Hello World" project
        • The build directory
        • The data directory
      • Building and running in the Windows simulator
    • Deploying a Marmalade project
      • Compiling the "Hello World" project for the ARM CPU
      • Deploying the "Hello World" project
        • Installing on Android devices
        • Installing on iOS devices
        • Installing on BlackBerry QNX devices
        • Installing on Bada devices
    • Summary
    • Chapter 2: Resource Management and 2D Graphics Rendering
      • The Marmalade ITX file format
        • The CIwManaged class
          • Instantiating a class with the class factory
          • Parsing a class
          • Serializing a class
          • Resolving a class
      • The Marmalade resource manager
        • Adding IwResManager to a project
        • Specifying resources with a GROUP file
        • Loading groups and accessing resources
        • The CIwResource class
        • GROUP file serialization
        • Resource handlers
      • Graphics APIs provided by the Marmalade SDK
        • The s3eSurface API
        • The IwGL API and OpenGL ES
        • The Iw2D API
        • The IwGx API
      • Using IwGx to render 2D graphics
        • IwGx initialization and termination
        • Rendering a polygon
          • Materials and textures
          • Vertex streams
          • Color streams
          • UV streams
          • Drawing a polygon
          • Displaying the rendered image
      • Example code
        • The ITX project
        • The Graphics2D project
        • The Skiing project
          • The GameObject class
          • The ModeManager and Mode classes
      • Summary
      • Chapter 3: User Input
        • Detecting key input
          • Initialization and update of key information
          • Detecting key state
            • Detecting key state changes using polling
            • Detecting key state changes using callbacks
          • Detecting character code input
            • Detecting character code input using polling
            • Detecting character code input using callbacks
          • Inputting strings
        • Detecting touch screen and pointer input
          • Determining available pointer functionality
            • Determining the type of pointer input
            • Determining the type of stylus input
          • Updating current pointer input status
          • Detecting single touch input
            • Detecting single touch input using polling
            • Detecting single touch input using callbacks
          • Detecting multi-touch input
            • Detecting multi-touch input using polling
            • Multi-touch input using callbacks
          • Recognizing gesture inputs
            • Detecting a swipe gesture
            • Detecting a pinch gesture
        • Detecting accelerometer input
          • Starting and stopping accelerometer input
          • Reading accelerometer input
          • Smoothing accelerometer input
          • Testing accelerometer input on the Windows simulator
        • Example code
          • The Gesture project
          • The Slide project
          • The Skiing project
            • Player rotation
            • The ModeTitle and ModeGameOver classes
            • The Camera class
            • The Input Manager classes
            • The SkierController class
        • Summary
        • Chapter 4: 3D Graphics Rendering
          • A quick 3D graphics primer
            • Describing a 3D model
              • Specifying a model's vertex stream
              • Specifying a model's index stream
              • Specifying a model's color, UV, and normal streams
            • Performing 3D to 2D projection
              • Understanding matrices for 3D graphics
              • Converting between coordinate systems
              • Clipping planes
            • Lighting
              • Emissive lighting
              • Ambient lighting
              • Diffuse lighting
              • Specular lighting
          • Using IwGx to render 3D graphics
            • Preparing IwGx for 3D rendering
            • Setting lighting information
            • Model data for the cube
            • The view matrix
            • The model matrix
            • Rendering the model
          • Using a 3D modeling package to create model data
            • The Marmalade 3D exporter plugins
              • Installing the plugins
              • Exporting a model
            • The Blender plugin
              • Installing Blender and the exporter plugin
              • Exporting a model
          • The Marmalade 3D model datafile formats
            • The GROUP file
            • The MTL file
            • The GEO file
          • Loading and rendering an exported 3D model
            • Adding the IwGraphics API to a project
            • Loading and accessing an exported 3D model
            • Rendering an exported 3D model
            • Releasing 3D model data
          • Example code
            • The Cube project
            • The Cube2 project
            • The Skiing project
              • Migration to 3D
              • Addition of a collision detection system
          • Summary
          • Chapter 5: Animating 3D Graphics
            • A quick 3D animation primer
              • Animating with model matrices
                • Animating by translation
                • Animating by rotation
                • Animating by scaling
              • 3D model animation
                • Using morph targets
                • Using boned animations
            • Using a 3D modeling package to create animation data
              • Exporting animations using the Marmalade 3D exporter plugins
              • Exporting animations using the Blender plugin
            • The Marmalade 3D animation file formats
              • The SKEL file
              • The SKIN file
              • The ANIM file
            • Loading and rendering an exported 3D animation
              • Adding the IwAnim API to a project
              • Loading and accessing a 3D animation
              • Playing back a 3D animation
              • Rendering a 3D animation
            • Exploring 3D animation further
              • Playing an animation backwards
              • Blending between animations
              • Detecting animation playback events
              • Optimizing animation playback
              • Playing sub-animations
              • Offset animations
              • Obtaining bone positions and rotations
            • Example code
              • The Flag project
              • The Skiing project
                • New gameplay features
                • Animations added
            • Summary
            • Chapter 6: Implementing Fonts, User Interfaces, and Localization
              • Implementing fonts
                • Adding the IwGxFont API to a project
                • Creating a font resource
                • The GXFONT file format
                • Loading and accessing font resources
                • Drawing text using a font resource
                  • Drawing text on screen
                  • Text wrapping and justification
                  • Changing font size at runtime
                  • Optimizing drawing by preparing text
              • Implementing user interfaces
                • The IwUI API
                • The IwNUI API
                • Implementing our own user interface solution
                  • Using a generic approach
                  • Making good use of class inheritance
                  • Implementing a data-driven system
                  • Responding to user input events
                  • Screen resolution and orientation
                  • Adding template functionality
              • Localizing your project
                • Creating a text spreadsheet
                • Getting the text into the game
                  • Comma-separated values files
                  • Processing using a Python script
                  • Selecting the correct language to use at runtime
              • Example code
                • The Font project
                • The UI project
                • The Skiing project
              • Summary
              • Chapter 7: Adding Sound and Video
                • Multimedia support in Marmalade
                • The s3eAudio API
                  • Starting audio playback
                  • Pausing, resuming, and stopping playback
                  • Changing volume
                  • Other audio queries
                  • End of track notification
                • The s3eSound API
                  • Starting sound playback
                  • Pausing, resuming, and stopping playback
                  • Global sound settings
                  • Sound notifications
                • The SoundEngine module
                  • Adding the SoundEngine module to a project
                  • Loading and accessing sound resources
                  • Playing, stopping, and altering sound parameters
                • The s3eVideo API
                  • Starting video playback
                  • Determining video codec support
                  • Pausing, resuming, and stopping video playback
                  • End of video notification
                  • Other video queries
                • Example code
                  • The Sound project
                  • The Video project
                  • The Skiing project
                • Summary
                • Chapter 8: Supporting a Wide Range of Devices
                  • Accommodating a wide range of device types
                    • Dealing with different screen resolutions
                    • Using different resources for different screen resolutions
                    • Checking device capabilities
                  • Configuring your game using ICF file settings
                    • Built-in ICF settings
                    • Defining new ICF settings
                    • Accessing ICF settings in code
                    • Limiting ICF settings by platform and device
                  • Creating multiple resource sets
                    • Using build styles
                      • Adding extra resource directories
                      • Supported build style platforms
                      • Specifying which build style to use
                    • Using resource templates
                      • Defining material templates
                      • Defining image templates
                      • Defining model templates
                      • Defining animation templates
                      • Defining GROUP file templates
                    • Producing binary versions of resources
                  • Compressing resources using the Derbh archiver
                    • Creating a Derbh archive
                    • Using a Derbh archive in code
                    • The automatic Derbh method
                  • Creating different deployment types
                    • Specifying icons, application names, and other details
                    • Specifying asset lists
                    • Creating and using deployment types
                  • Example code
                    • The build styles project
                    • The Skiing project
                  • Summary
                  • Chapter 9: Adding Social Media and Other Online Services
                    • Launching a web page in the device browser
                    • Integrating with social media
                      • Using Facebook
                        • Creating a Facebook app
                        • Creating a Facebook test user
                        • Adding the s3eFacebook API to a Marmalade project
                        • Checking for s3eFacebook support
                        • Initialization and termination
                        • Logging in and out of Facebook
                        • Posting a message to a user's wall
                        • Further s3eFacebook features
                      • Using Twitter
                    • Connecting to other types of online services
                      • Supporting social gaming networks
                        • Using Apple's Game Center
                        • Using Scoreloop
                      • Supporting in-app purchases
                        • Adding in-app purchasing for iOS devices
                        • Adding in-app purchasing for Android devices
                      • Using advertising
                        • Implementing iAd support for iOS devices
                        • Using other advertising solutions
                    • Example code
                      • The Facebook project
                      • The Skiing project
                    • Summary
                    • Chapter 10: Extending Marmalade with the Extensions Development Kit (EDK)
                      • Why is the EDK necessary?
                      • Creating an extension for gyroscope input
                        • Declaring the extension API
                        • Making an extension for Windows
                          • Creating a Windows extension
                          • Implementing a Windows extension
                          • Building a Windows extension
                        • Making an Android extension
                          • Installing the required software for Android development
                          • Creating an Android extension
                          • Implementing an Android extension
                          • Building an Android extension
                        • Making an iOS extension
                          • Installing the required software for iOS development
                          • Creating an iOS extension
                          • Implementing an iOS extension
                          • Building an iOS extension
                      • Using the Gyroscope extension
                      • Example code
                        • The Gyroscope project
                        • The GyroTest project
                        • The Skiing project
                      • Summary

                      Sean Scaplehorn

                      Sean Scaplehorn is a programmer with 15 years of experience in the videogames industry, who has worked on projects for both console and mobile devices. He has worked on games published by companies including Sony, Electronic Arts, Konami, Square Enix, and Namco. Sean got his first home computer while still at primary school, which kick-started his interest in programming. After learning to code from typing in listings printed in computer magazines, he went on to write his own games and shared them with his school friends. He knew then that writing games was what he wanted to do when he grew up. However, on leaving university, Sean spent a couple of years writing software for printing check books. When he could stand it no longer, he made the leap into videogames development and hasn't looked back since. He worked at Ideaworks3D, the company behind the Marmalade SDK, for four years. In this time he saw the Marmalade SDK evolve from an in-house technology to being a product in its own right, when it was launched as the Airplay SDK. Sean now works from his home in the South of England as a freelance game coder.
                      Sorry, we don't have any reviews for this title yet.

                      Code Downloads

                      Download the code and support files for this book.


                      Submit Errata

                      Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


                      Errata

                      - 1 submitted: last submission 07 Dec 2012

                      Errata Type: Code

                      The code for adding a Quit Game option for Android devices is as follows:

                      if (s3eKeyboardGetState(s3eKeyBack) & S3E_KEY_STATE_PRESSED)
                      {
                      s3eDeviceRequestQuit();
                      }

                      It should be added to the end of the ModeTitle::Update method, by extending the KeyManager class.

                      Sample chapters

                      You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                      Frequently bought together

                      Marmalade SDK Mobile Game Development Essentials +    Windows Presentation Foundation 4.5 Cookbook =
                      50% Off
                      the second eBook
                      Price for both: £19.54

                      Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                      What you will learn from this book

                      • See a complete game develop from start to finish as you journey through the book.
                      • Deploy to several leading mobile platforms all from a single C++ codebase
                      • Implement amazing 2D and 3D graphics and animation
                      • Easily manage the graphics, sound and data assets your game requires by using Marmalade’s resource management system
                      • Best practices when developing user interfaces for mobile games
                      • Harness the wide range of possible input methods available on modern devices including touch screen and accelerometers
                      • Learn how to extend the Marmalade SDK to support device specific features using the Extensions Development Kit (EDK
                      • Support a wide range of devices with different specifications such as processor speed and graphical ability

                      In Detail

                      Modern mobile devices are capable of supporting video games of amazing quality but there are so many different devices and platforms how can you support them all?  The answer is to use the Marmalade SDK to write your code once and deploy it to all popular mobile platforms at the touch of a button.

                      Marmalade SDK Mobile Game Development Essentials will provide you with everything you need to know to transfer your existing C++ videogame programming knowledge to mobile devices.  From graphics and sound to input methods and actual deployment to device, this book covers the lot.Learn how to make use of keys, touch screen and accelerometer inputs for controlling your game.Take the pain out of supporting a varied range of target devices, both across multiple platforms and multiple specifications.

                      Step by step from “Hello World” to a complete game, this book will show how to use the Marmalade SDK to develop games for mobile devices.

                      Learn how to make dazzling 2D and 3D games complete with fully animated characters, music and sound effects that can be deployed to all the leading mobile platforms, whilst ensuring it can run on a wide range of possible devices, from low specification to high end.

                      If you want to join the exciting world of mobile videogames then Learning Mobile Game Development with Marmalade will show you how to do so, fast!

                      Approach

                      A practical tutorial that's easy to follow with lots of tips, examples and diagrams, including a full game project that grows with each chapter.

                      Who this book is for

                      This book targets Professional and Indie game developers who want to develop games quickly and easily to run across a huge range of smartphones and tablets. You are expected to have some experience writing games using C++ on other platforms. Its aim is to show how to take your existing skills and apply them to writing games for mobile devices (including iOS and Android) by explaining the use of the Marmalade SDK. 

                      Familiarity with games and 3D graphics programming would be helpful. No knowledge of specific mobile SDKs such as iOS or Android is required.

                      Code Download and Errata
                      Packt Anytime, Anywhere
                      Register Books
                      Print Upgrades
                      eBook Downloads
                      Video Support
                      Contact Us
                      Awards Voting Nominations Previous Winners
                      Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                      Resources
                      Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software