Cocos2d Game Development Blueprints
eBook - ePub

Cocos2d Game Development Blueprints

Jorge Jordan

Buch teilen
  1. 440 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Cocos2d Game Development Blueprints

Jorge Jordan

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Cocos2d Game Development Blueprints als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Cocos2d Game Development Blueprints von Jorge Jordan im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Computer Science & Programming Mobile Devices. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

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.

Inhaltsverzeichnis