Cocos2d Game Development Blueprints
eBook - ePub

Cocos2d Game Development Blueprints

Jorge Jordan

Compartir libro
  1. 440 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Cocos2d Game Development Blueprints

Jorge Jordan

Detalles del libro
Vista previa del libro
Índice
Citas

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Cocos2d Game Development Blueprints un PDF/ePUB en línea?
Sí, puedes acceder a Cocos2d Game Development Blueprints de Jorge Jordan en formato PDF o ePUB, así como a otros libros populares de Computer Science y Programming Mobile Devices. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
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.

Índice