Cocos2d Game Development Blueprints
eBook - ePub

Cocos2d Game Development Blueprints

Jorge Jordan

Partager le livre
  1. 440 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Cocos2d Game Development Blueprints

Jorge Jordan

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Cocos2d Game Development Blueprints est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Cocos2d Game Development Blueprints par Jorge Jordan en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Computer Science et Programming Mobile Devices. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2015
ISBN
9781783987887

Cocos2d Game Development Blueprints


Table of Contents

Cocos2d Game Development Blueprints
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
Cocos2d v3.0
Pure Objective-C
ARC
CCDirector
CCLayer
CCArray
OALSimpleAudio
CCAction
CCActionCallBlock
Sequences
Schedule update
Enabling touches
Accelerometer events
Physics
What this book covers
What you need for this book
Who this book is for
Conventions
1-star challenge – accurate collision detection
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Sprites, Sounds, and Collisions
Creating a new Cocos2d project
Run Xcode Run
Understanding the default project
CCNode
Your first game – RunYetiRun
Creating the CCScene class
Adding the first CCSprite class
Anchor points
Placing things in context
Time for CCAction
Actions under control
Throwing some snowballs
Rolling down the hill
Managing collisions
Adding labels
CCLabelTTF
Updating labels
Making some noise
OALSimpleAudio
Voice memos
Audacity
GarageBand
Audio resources
Playing audio files
Game over
1-star challenge – accurate collision detection
The solution
2-star challenge – having three lives
The solution
Summary
2. Explosions and UFOs
Handling the accelerometer input
Linking the CoreMotion framework
onEnter and onExit
Converting accelerometer input into movements
Calibrating the accelerometer
Implementing the parallax effect in Cocos2d
CCParallaxNode
Particle systems
CCParticleSystem
CCParticleSystem modes
CCParticleSystemModeGravity
CCParticleSystemModeRadius
Common properties
Particle Designer
Extending CCSprite
Shooting some lasers
When UFOs collide
2-star challenge – create explosions
The solution
The attack of the aliens
Drawing and coloring
Drawing the life bar
1-star challenge – collision detection between Dr. Fringe and the UFO
The solution
Summary
3. Your First Online Game
Getting started with our project
Initializing the game
Creating labels with CCLabelBMFont
Littera
CCActions in depth
Drag, drop, and scale
Game Center
Configuring Game Center in iTunes Connect
Configuring the game in Xcode
Checking Game Center's availability
Authenticating the player
Turn-based games
The first turn
Passing the turn
Receiving the turn
Fighting cards
Labels for life points
Match over
Viewing the status when it's not our turn
Summary
4. Beat All Your Enemies Up
Creating an iPad-only game
Image sizes and names
Developing virtual game controls
Moving the zombie
CCSpriteBatchNode
Texture atlases
Creating texture atlases with TexturePacker
Loading texture atlases with Cocos2d
Creating your first animation
3-star challenge – hitting the air
The solution
Creating the zombie class
Creating the human enemies class
Keeping the main character in view
Taking human decisions
Drawing a life bar
Detecting collisions with enemies
2-star challenge – enemies' life bar
Game over
Summary
5. Scenes at the Highest Level
Initializing the game
Developing a tutorial for our game
Storing data using NSUserDefault
Loading data from external files
Transitions
3-star challenge – create a map scene
Summary
6. Physics Behavior
Physics engines
Game physics in Cocos2d
Introducing Chipmunk
CCPhysicsNode
CCPhysicsBody
Creating your first physics
CCPhysicsShape
Creating sprites with physics
Defining shapes
PhysicsEditor
Defining shapes
Loading PhysicsEditor shapes in Xcode
Advanced collision detection with Chipmunk
CCPhysicsBody and CCPhysicsShape properties
CCPhysicsCollisionDelegate
Creating a snooker game with Chipmunk
Setting the snooker table
Configuring the snooker balls
Hitting the cue ball
Managing collisions between snooker bodies
Summary
7. Jump and Run
Initializing the game
Configuring a varied scene
Scrolling the background and blocks
Coding custom physics
Jumping over the platforms
Adding a menu to the game
2-star challenge – adding pinecones to the scene
The solution
1-star challenge – adding a score label
The solution
Summary
8. Defend the Tower
Initializing the game
Developing a pathfinding algorithm
Following the path
Predefining defensive positions
Placing defenses
Giving AI to the defenses
Sharing information between nodes
Loading waves of enemies
2-star challenge – adding explosions
3-star challenge – upgrading defenses
Summary
Index

Cocos2d Game Development Blueprints

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: 1230115
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78398-788-7
www.packtpub.com
Cover image by Vanesa Domingo ()

Credits

Author
Jorge JordĂĄn
Reviewers
Saeed Afshari
Nader Eloshaiker
Mohsin Mahmood
Commissioning Editor
Ashwin Nair
Acquisition Editor
Richard Brookes-Bland
Content Development Editor
Sumeet Sawant
Technical Editor
Siddhi Rane
Copy Editors
Safis Editing
Ameesha Green
Project Coordinator
Judie Jose
Proofreaders
Ameesha Green
Steve Maguire
Jonathan Todd
Indexer
Mariammal Chettiyar
Graphics
Vanesa Domingo
Production Coordinator
Aparna Bhagat
Cover Work
Aparna Bhagat

About the Author

Jorge JordĂĄn is an iOS indie developer who has been passionate about how things work since his childhood. This is the reason why he graduated in Computer Science and became a Java developer. After buying his first iPhone, he became deeply interested in its technology and spent his spare time learning how to develop apps for Apple smartphones.
Over time, he founded Insane Platypus Games (http://insaneplatypusgames.com/) where he tries to make his dreams and games come true. He is also a member of the tutorial team at http://www.raywenderlich.com/.
In his free time, he loves to play video games and bass guitar, and to watch TV series.
You can follow him on Twitter @jjordanarenas.

Table des matiĂšres