Creating Games with cocos2d for iPhone 2


Creating Games with cocos2d for iPhone 2
eBook: $26.99
Formats: PDF, PacktLib, ePub and Mobi formats
$22.94
save 15%!
Print + free eBook + free PacktLib access to the book: $71.98    Print cover: $44.99
$35.99
save 50%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters
  • Games are explained in detail, from the design decisions to the code itself
  • Learn to build a wide variety of game types, from a memory tile game to an endless runner
  • Use different design approaches to help you explore the cocos2d framework

Book Details

Language : English
Paperback : 388 pages [ 235mm x 191mm ]
Release Date : December 2012
ISBN : 1849519005
ISBN 13 : 9781849519007
Author(s) : Paul Nygard
Topics and Technologies : All Books, Game Development, Mobile, Games, Open Source

Table of Contents

Preface
Chapter 1: Thanks for the Memory Game
Chapter 2: Match 3 and Recursive Methods
Chapter 3: Thumping Moles for Fun
Chapter 4: Give a Snake a Snack…
Chapter 5: Brick Breaking Balls with Box2D
Chapter 6: Cycles of Light
Chapter 7: Playing Pool, Old School
Chapter 8: Shoot, Scroll, Shoot Again
Chapter 9: Running and Running and Running...
Index
  • Chapter 1: Thanks for the Memory Game
    • The project is...
    • Let's build a menu
      • Where is the scene?
      • Building the playfield
    • We need sprites
      • Building a sprite sheet
    • On to the playfield
      • Creating the playfield header
      • Creating the playfield layer
    • The flow of the game
    • A stack of tiles
      • The memory tile class
      • Loading tiles
      • Drawing tiles
    • Adding interactivity
      • Checking for matches
    • Scoring and excitement
    • Animating the score
      • Adding lives and game over
      • Bringing it all together
      • It's quiet...too quiet
    • Summary
    • Chapter 2: Match 3 and Recursive Methods
      • The project is…
      • Basic gem interaction
        • The MAGem header
        • The MAGem class
        • Generating gems
      • Building the playfield
      • Checking for matches
        • Collecting touches
        • Moving gems
      • Checking moves
        • Removing gems
        • The update method
      • Predictive logic
      • Artificial randomness
      • Summary
      • Chapter 3: Thumping Moles for Fun
        • The project is…
          • Design approach
          • Designing the spawn
          • Portrait mode
          • Custom TTF fonts
        • Defining a molehill
          • Building the mole
        • Making a molehill
          • Drawing the ground
        • Mole spawning
          • Special moles
          • Moving moles
          • The animation cache
        • Combining actions and animation
          • Simultaneous actions
          • Deleting moles
        • Touching moles
        • Tying it together
          • Scoring the mole
        • Summary
        • Chapter 4: Give a Snake a Snack…
          • The project is…
            • Design approach
          • Building a better snake
            • Anatomy of a snake segment
            • Dissecting the snake
            • Building the head
            • Building the body segments
          • Moving the snake
            • Turning the snake
            • Death of a snake
          • Building the environment
            • Outer walls
            • Inner walls
            • Building snake food
          • Collisions and eating
          • Levels and difficulties
          • The main loop
            • Level-up checking
            • Dead mice
          • But…how do we control the snake?
          • Summary
          • Chapter 5: Brick Breaking Balls with Box2D
            • The project is…
            • Box2D – a primer
              • Box2D – what is it?
                • Basic parts of Box2D
            • On to the game!
              • World building
              • On the edge
              • Having a ball
            • Setting everything in motion
              • Collision handling
              • Losing your ball
              • Destruction
            • Paddling around
              • Paddle fixture
              • Touching the paddle
            • Storing player data
              • Displaying player data
            • Building bricks
              • Loading a plist
              • Picking a pattern
            • Breaking bricks, for real
            • Power-ups, good and bad
              • Picking up power-ups
              • Paddle deformation
              • Restoring the paddle
              • Multiball
              • Losing lives with multiball
            • Summary
            • Chapter 6: Cycles of Light
              • The game is…
              • Design review
              • Let's build a bike
                • CLBike header
                • CLBike implementation
                • Bike rotation
                • Turning the bike
              • Building walls
                • Boundary walls
                • Bike walls
                • Bike integration
              • Bike movement
              • Control buttons
                • Touching buttons
                • Flashing with blocks
                • Finishing the buttons
              • Building the background grid
                • Drawing the grid
                • The second grid
                • Moving grids
                • The glScissor
              • The playfield
                • Generating the bikes
                • Collision handling
                • Making it move
                • Crashing bikes
              • Bluetooth multiplayer
                • Peer Picker
                • Session callbacks
                • Sending messages
                • Receiving data
                • Upgrading our bikes
                • Why send moves?
              • Summary
              • Chapter 7: Playing Pool, Old School
                • The game is…
                • Overall design
                • Building the table
                  • The Box2D world
                  • Building the rails
                  • Building pockets
                  • Creating the cue stick
                • Loading the rules
                  • Rules.plist
                • Rack 'em up
                  • Building the rack
                • Player HUD
                  • Displaying messages
                • Collision handling
                • Building the control base
                  • One-touch control
                  • Two-touch control
                • The rules engine
                • Putting balls back
                • Checking the table
                • The playfield init method
                • Summary
                • Chapter 8: Shoot, Scroll, Shoot Again
                  • The game is…
                  • Design review
                  • Tiled – a primer
                    • Drawing the ground
                    • Logic layers
                    • Spawn layer
                    • Understanding TMX format
                    • Creating an HD map
                  • Implementing the tilemap
                  • Adding our hero
                    • Focus on the hero
                  • Controlling the hero with SneakyJoystick
                    • Tilt controls
                    • Interpreting the controls
                  • Building the HUD
                  • Scene construction
                  • Tile helper methods
                    • Tile self-identification
                  • Smarter hero walking
                  • Time for bullets
                    • TDBullet class
                  • Building the enemy
                    • Adding the enemies
                  • Collision handling
                    • Everybody gets hit
                  • Game over, man
                  • Smarter enemies
                    • Code not covered here
                  • Summary
                  • Chapter 9: Running and Running and Running...
                    • The Game Is...
                    • Design review
                    • Building the ground
                      • ERTile class
                      • Adding gap tiles
                      • Scrolling the tiles
                    • Parallax background
                    • Our hero
                      • Animation loading
                      • Updating the hero
                    • Touch controls
                    • Shooting bullets
                    • Enemies everywhere
                    • Collision handling
                      • Getting shot with particles
                      • Death of hero
                    • Summary

                    Paul Nygard

                    Paul Nygard has been a computer and technology enthusiast since he was introduced to his first computer at the age of six. He has spent most of his professional life building reporting and analytical systems for a large company. After teaching himself Objective-C in 2010, he has focused most of his attention on iOS programming. Paul created a personal development label, Troll Cave Games (http://www.trollcavegames.com), to release his mobile gaming efforts. Paul also works as a consultant and developer-for-hire for visionaries in need of a coder. In his leisure time, Paul is passionate about games, books, and music.
                    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.

                    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

                    Creating Games with cocos2d for iPhone 2 +    Cocos2d for iPhone 1 Game Development Cookbook =
                    50% Off
                    the second eBook
                    Price for both: €30.90

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

                    What you will learn from this book

                    • Control sprites with touch, joysticks, and tilt controls
                    • Use sprite sheets, particles, and plists effectively
                    • Learn multiple approaches to solve common challenges
                    • Integrate cocos2d with the Box2D physics engine
                    • Use third-party programs for joystick control, tile maps, and more
                    • Implement Bluetooth to play across multiple devices
                    • Learn game-specific A.I. design methodologies

                    In Detail

                    Cocos2d for iPhone is a simple (but powerful) 2D framework that makes it easy to create games for the iPhone. There are thousands of games in the App Store already using cocos2d. Game development has never been this approachable and easy to get started.

                    "Creating Games with cocos2d for iPhone 2" takes you through the entire process of designing and building nine complete games for the iPhone, iPod Touch, or iPad using cocos2d 2.0. The projects start simply and gradually increase in complexity, building on the lessons learned in previous chapters. Good design practices are emphasized throughout.

                    From a simple match game to an endless runner, you will learn how to build a wide variety of game styles.

                    You will learn how to implement animation, actions, create “artificial randomness”, use the Box2D physics engine, create tile maps, and even use Bluetooth to play between two devices.

                    "Creating games with cocos2d for iPhone 2" will take your game building skills to the next level.

                    Approach

                    There are nine complete games with increasing complexity built in this book. The process of game building is well-illustrated with screenshots and explained code.

                    Who this book is for

                    This book is aimed at readers with an understanding of Objective-C and some familiarity with the cocos2d for iPhone 2.0 framework.

                    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