Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Cocos2d Game Development Blueprints
  • Table Of Contents Toc
Cocos2d Game Development Blueprints

Cocos2d Game Development Blueprints

By : Jorge Jordán
5 (2)
close
close
Cocos2d Game Development Blueprints

Cocos2d Game Development Blueprints

5 (2)
By: Jorge Jordán

Overview of this book

Whether you are a passionate gamer, like developing, or are just curious about game development, this book is for you. The book has been written to teach 2D game development to app developers and to teach Objective-C to game developers, as learning Cocos2d is the perfect step for both roles.
Table of Contents (10 chapters)
close
close
9
Index

CCSpriteBatchNode

To improve the tasks involved in drawing a texture on the screen, we can take advantage of the CCSpriteBatchNode class, which wraps the multiple sprite renders in just one execution.

The only objects that can be added to CCSpriteBatchNode are CCSprite instances or any other class derived from CCSprite. There is another restriction: every child in the batch must make use of the same texture, but we will see in the next section that this isn't in fact a weakness.

Let's learn how to use this class by adding several enemies to the scene, so let's add the image that will represent them:

  1. Right-click on the Resources group and select Add Files to "HumanApocalypse"….
  2. Look for the human-ipad.png and human-ipadhd.png files in the Resources folder.
  3. Be sure that Copy items into destination group's folder (if needed) is selected and click on Add.

Define a constant value for the number of human enemies that will be loaded by adding the following line to...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Cocos2d Game Development Blueprints
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon