Cocos2D Game Development Essentials
eBook - ePub

Cocos2D Game Development Essentials

Ben Trengrove

Share book
  1. 136 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Cocos2D Game Development Essentials

Ben Trengrove

Book details
Book preview
Table of contents
Citations

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Cocos2D Game Development Essentials an online PDF/ePUB?
Yes, you can access Cocos2D Game Development Essentials by Ben Trengrove in PDF and/or ePUB format, as well as other popular books in Informatica & Programmazione di dispositivi mobili. We have over one million books available in our catalogue for you to explore.

Information

Cocos2D Game Development Essentials


Table of Contents

Cocos2D Game Development Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Getting Started with Cocos2d
An introduction to Cocos2d
Installing Cocos2d
Installing Cocos2d with the installer
Creating a Hello World project
Installation for Android
Template project code breakdown
IntroScene.m
The HelloWorldScene.m class
Summary
2. Nodes, Sprites, and Scenes
The building blocks, nodes
Children nodes
Adding children
Removing children
Drawing order of the children nodes
Working with multiple coordinate systems
Sprites
Putting it into practice
Adding nodes to the scene
Detecting touches and responding
The next step
The Cocos2d update loop
Scenes
Scene life cycle
Creating a CCScene
Transitioning to another scene
Putting it into practice
Summary
3. SpriteBuilder
Creating a new project
The Main editor window
The Resource pane
The Options pane
The Timeline pane
Creating Flappy Square
Creating a new scene/layer
Linking to a SpriteBuilder scene in code
Enabling physics in SpriteBuilder
Connecting SpriteBuilder objects to Xcode properties
Creating reusable components
Moving obstacles across the screen
Detecting collisions
The next step
Summary
4. Animation with SpriteBuilder
Adding sprites to SpriteBuilder
Creating sprite frame animations
Switching out the obstacle image
Particle systems
Designing a particle system for our character
Adding a SpriteBuilder particle system in code
Final polish to Flappy Bird
Keyframe animation in SpriteBuilder
Animation in code
Moving, scaling, and rotating
Chaining actions together
Running actions simultaneously
Repeating actions
Running code on completion of an animation
Summary
5. User Interaction and Interface
Detecting touches
Getting the touch location
Dragging a node
Adding buttons to your scene
Accepting user input with form elements
Presenting data in a table with CCTableView
Creating a CCTableView data source
Adding a CCTableView node to the scene
Summary
6. Physics Engines
Introducing physics engines
Adding joints
Adding a sprite joint
Dragging an object against a spring joint
Firing objects from the catapult
Creating a motor
The next step
Summary
Index

Cocos2D Game Development Essentials

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: January 2015
Production reference: 1190115
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78439-032-7
www.packtpub.com
Cover image by Ben Trengrove ()

Credits

Author
Ben Trengrove
Reviewers
K. Aava Rani
Sergio MartĂ­nez-Losa Del RincĂłn
Allen Sherrod
Commissioning Editor
Akram Hussain
Acquisition Editor
Richard Gall
Content Development Editor
Poonam Jain
Technical Editor
Parag Topre
Copy Editor
Relin Hedly
Project Coordinator
Mary Alex
Proofreaders
Simran Bhogal
Linda Morris
Indexer
Mariammal Chettiyar
Graphics
Abhinash Sahu
Production Coordinator
Alwin Roy
Cover Work
Alwin Roy

About the Author

Ben Trengrove is an experienced iOS developer who started developing with the release of the first iOS SDK. He spent 3 years as the senior developer at Shiny Things (http://getshinythings.com), where he lead the creation of all Shiny Things games using Cocos2d. These apps have been featured as the editor's choice by Apple around the world. Today, Ben runs a mobile app agency that is based out of Canberra, Australia—Stripy Sock (http://stripysock.com.au).

About the Reviewers

K. Aava Rani is the cofounder of CulpzLab Pvt Ltd, a software company, with 10 years of experience in game technologies. A successful blogger and a technologist, she switched her focus to game development in the year 2004. Since then, she has produced a number of game titles and has provided art and programming solutions to Unity developers across the globe. She is based in New Delhi, India. Aava Rani has been the recipient of several prestigious awards, including Adobe for Game Technology Expert 2012 ...

Table of contents