Book Image

Cocos2d for iPhone 0.99 Beginner's Guide

By : Pablo Ruiz
Book Image

Cocos2d for iPhone 0.99 Beginner's Guide

By: Pablo Ruiz

Overview of this book

<p>Cocos2d for iPhone is a robust but simple-to-use 2D game framework for iPhone. If you are just starting with game programming, cocos2d will enable you to make your first game in no time. Even if you are a seasoned game developer, you will still be able to benefit from what it offers. Yet beginning with cocos2d for iPhone may be an arduous task without a proper guide.</p> <p><i>Cocos2d for iPhone 0.99 Beginner</i>&rsquo;s Guide will help you to learn how to make games with cocos2d from the ground up. You will learn all the key concepts of the framework and game programming in general while building your first game using this exciting platform.</p> <p>You will start by learning the basics of cocos2d then you will learn how to enhance your game with a lot of cool features and eye candy. After spending a little time learning the basics, you will jump straight into action. The book will then teach you to build games from scratch and how to add animations, sounds, and particle effects to them. Then you will be guided to have your game behave as in real life by using a physics engine. After reading <i>Cocos2d for iPhone 0.99 Beginner's Guide</i>, you will be able to write your own games for iPhone while using all the elements Pros use. There are a lot of examples, images, and diagrams to get you up to speed in no time.</p>
Table of Contents (18 chapters)
Cocos2d for iPhone 0.99 Beginner's Guide
Credits
About the Author
About the Reviewers
Preface
Index

Time for action – checking Cocos2d debug messages


Let's take a look at the HelloCocos2d project and the debug message that it generates. They will be few, but as you add more elements to your game, you will be able to get a lot of useful information from this data, as shown here:

  • Run the HelloCocos2d application.

  • Once it is running, open the Console. To do this go to Run | Console (Shift + cmd + R)

  • You will see the following output:

2010-04-09 15:05:13.189 HelloCocos2d[3197:207] cocos2d: cocos2d v0.99.1
2010-04-09 15:05:13.207 HelloCocos2d[3197:207] cocos2d: Using Director Type:CCDisplayLinkDirector
2010-04-09 15:05:13.388 HelloCocos2d[3197:207] cocos2d: GL_VENDOR:   Apple Computer, Inc.
2010-04-09 15:05:13.389 HelloCocos2d[3197:207] cocos2d: GL_RENDERER: Apple Software Renderer
2010-04-09 15:05:13.389 HelloCocos2d[3197:207] cocos2d: GL_VERSION:  OpenGL ES-CM 1.1 APPLE
2010-04-09 15:05:13.390 HelloCocos2d[3197:207] cocos2d: GL_MAX_TEXTURE_SIZE: 2048
2010-04-09 15:05:13.391 HelloCocos2d[3197:207] cocos2d: Supports PVRTC: YES
2010-04-09 15:05:13.391 HelloCocos2d[3197:207] cocos2d: GL_MAX_MODELVIEW_STACK_DEPTH: 16
2010-04-09 15:05:13.425 HelloCocos2d[3197:207] cocos2d: Frame interval: 1

There you can see the current version of Cocos2d, the type of CCDirector it is using (we talked about them a while back), the version of OpenGL it is using, and so on.

What just happened?

We have just seen how to open the Xcode's Console. Now, you can get a lot more information from Cocos2d debug messages, such as when a particular object is dealloced.