Coconut College

On September 16, 2010, in cocos2d, by Steffen Itterheim

Coconut College is a new cocos2d Tutorial website that looks really promising. Right now there seem to be only 3 tutorials online but I really like the writing and the layout (albeit the layout is a bit too wide/big for my taste). Kudos to whoever made it. Don’t forget, you remain elusive until you add a “About me” page. Comments would also be nice. Hint, hint. ;)

Tagged with:  

cocos2d Book, Chapter 5: Getting bigger and better

On July 23, 2010, in Announcements, book, by Steffen Itterheim

Chapter 5 – Getting bigger and better

The gist of this chapter will be to discuss the simple game project from the previous chapter. I threw everything into one class, clearly not what you want to do for bigger games. But getting from one-class to real code design is a big step which some hesitate to take. I’ll make that easier and discuss common issues and their solutions, such as what to seperate, what to subclass from and how you can have all the seperated objects communicate with each other and exchange information in various ways.

A big topic will of course be how to take advantage of cocos2d’s scene hierarchy and which pitfalls it may have when moving from a single-layer game to one which has multiple layers and even multiple scenes.

As for the chapter title I’m not so sure if that’ll be it. Maybe along the way while I’m writing I’ll change it. Suggestions welcome!

The chapter will be submitted on Friday, July 30th.

What’s your take on good cocos2d code structure?

Did you ever struggle with cocos2d design concepts? Or the cocos2d scene hierarchy? Or how to layout a scene and divide your game into logical parts? Tell me about it.

I know theses questions are somewhat generic to ask. It’s about the things that don’t feel right but there doesn’t seem to be a better, more obvious way. I think we all know some of those, if you do, be sure to tell me! Leave a comment or write me an email.

Summary of working on Chapter 4 – First simple game

The game I chose to make is called Doodle Drop and features dropping spiders and an accelerometer controlled alien trying to avoid the spiders. All in all it got divided into 8 concrete steps. Lots and lots of code comments, too.

It starts simple enough, adding resources to Xcode and adding sprites. It gets more gameplay-esque when the accelerometer-driven player controls got tweaked to provide acceleration and deceleration of the player object. In contrast, the spiders movements are driven only by actions.

I introduce you to two undocumented features of cocos2d, namely CCArray which is since v0.99.4 used to store all children of a node. The other are the CGPointExtension class which has all the functions normally provided by a physics engine, however not every game should link a physics engine just because one needs those math functions. That’s why CGPointExtension comes in handy.

With the ccpDistance method the collision checks are done. Simple radial collisions, and in debug mode the collision radii are drawn too.

In between the CCLabel for the score got replaced with a CCBitmapFontAtlas, because it killed the framerate. I shortly mentioned Hiero and how to use it in principle but for all the details there was no room. But while I was at it I created the Hiero Tutorial.

At the end of the project I added some polish which isn’t described in the book (too many details) but really adds to the game’s look and feel. The spiders drop, hang in there, then charge before dropping down, all done using actions. I’ve also added the thread they’re hanging from using ccDrawLine. And then there’s a game over label which shows even more action use.

One of the principles I followed is to stay away from fixed coordinates as much as possible. So the project, once finished, did run just fine on an iPad. Although the experience is a different one, there’s more spiders dropping and they drop faster but there’s also more safe space to maneuver to.

Oh and, the game art is all mine. Yes, I know … but Man-Spiders do have just six legs! :)

cocos2d Book, Chapter 3: Essentials

On July 10, 2010, in Announcements, book, cocos2d, by Steffen Itterheim

Chapter 3 – Essentials

This chapter is a reference about the fundamental classes of cocos2d and how to use them. Nodes, Layers, Scenes, Labels, Sprites, Transitions, Actions, you name it. Also CCDirector, SimpleAudioEngine and other often used singleton classes as well. More advanced concepts will be discussed in a later chapter, Spritesheets for example.

The submission of the first chapter draft is due next Friday, July 16th.

What do you think should be in Chapter 3?

Do you know a cocos2d class or process that you think is essential and should be discussed in this chapter? Let me know!

Summary of working on Chapter 2 – Getting Started

For one I detailed the Hello World sample project and made a simple modification using touch input. At the same time at least some basic level of understanding about cocos2d classes was introduced but the gist of it is done in Chapter 3. In addition, there were a lot of theoretical aspects I wanted to discuss as well, most of all Memory Management and available memory as well as setting expectations on testing on Simulator vs. a device. And of course the devices and their subtle differences. I do hope that those kind of details are appreciated even if they’re not 100% related to cocos2d. I regularly see cocos2d developers struggling with memory issues, with unexpected differences on the device vs the Simulator, or comparing framerates of the Simulator and possibly even Debug builds. That made me want to stray off the beaten path for a moment to hopefully save the readers some misconceptions and the pain associated with them.

I also realized how many steps a new developer has to go through and how much there is to learn in case you’ve never been working with the iPhone SDK before. It starts with registering as iPhone developer and doesn’t end with installing the SDK because you also need the provisioning profiles, a much discussed and troublesome feature. For all of this I refered to existing (and excellent) Apple documentation. Typically the processes change with each new iPhone SDK or may even be under NDA, so discussing how all of this works with iPhone SDK 4 wouldn’t be a good idea since shortly after the book is out iPhone SDK 5 may be coming, introducing changes to the Developer Portal and iTunes Connect with it. It did get me the idea, and I know others have it too, that we need some holding-hands Tutorial which takes one through the steps from registering as iPhone Developer to publishing one’s first App, by referring to the correct official documentation for each step while not forgetting about common pitfalls that are not in the official docs.

I also noticed how easy it can be to overlook how you suddenly introduce a new concept without explaining it first. And then you have to decide how much information is necessary to introduce the concept without straying too far away from what you want to talk about in the first place. It’s especially hard for me because I tend to want to explain everything in detail but some things have to be left for a later discussion. I’m looking forward to editorial feedback now. It has helped tremendeously for the first chapter and I learned a lot from the Apress editorial staff, so I find it exciting that the experts point me to the flaws and make suggestions, I go in to fix them and then see how much better it is. That’s how I like to learn things and it’s going to be one of the core concepts of the book. Show how it’s done, how it shouldn’t be done (if it’s often done wrong) and how it can be done even better if you want to avoid trouble in the long run, while explaining why.

I’m writing a book for Apress:

Learn iPhone and iPad Cocos2D Game Development: The Leading Framework for Building 2D Graphical and Interactive Applications

I guess someone wanted to be very precise and thorough. :D

I will blog about the book’s progress here and when it’s published I will add additional materials so readers can continue their journey here. Since this journey is just beginning – I’m submitting the first chapter aptly titled “Introduction” tomorrow – and writing a whole 400 pages book is an entirely new experience to me, I want to let you in on the journey.

Help me help you by providing feedback to the book’s content as I’m writing it!

For the coming weeks, I will announce the current book chapter title and a short description and ask you what you’d like to see in this chapter. I will make these posts every Friday starting tomorrow until the book is complete. In this post you could start by telling me what you’d expect from this book or what you’d like to see in it just given its title? I guess your answer will be “a lot” given the title’s elongated nature. :p

I hope you forgive me if content updates to this website will not be as comprehensive over the coming months, in favor of writing the book and coding sample games. Plus I’m cooking up something special on the side, but all in due time.

Oh, by the way, if you happen to know what kind of fruit that is on the cover I’d like to know. I could just ask my editor but I’d like to see if we can figure it out without the help from Apress. It doesn’t really look like a coconut to me, which would have been fitting given the subject. If you have any ideas what fruit it is, let me know! It sure looks exotic and it’s definetely not a banana nor a lemon. So what is it? The first to post the correct answer in a comment, together with a link to Wikipedia or some other website as proof, gets a copy of the book for free when it’s out (or $40 now)!

And now for something completely different …

As a side note, the Xcode project files from the Xcode Tutorial are now available for download here. I used to ask you to join my Newsletter but I don’t feel too good about hooking you up with my Newsletter using the project as a dangling carrot, so joining the Newsletter will now be a completely voluntary thing. I only send newsletters for substantial updates and important news, at most once or twice per month, so that’s the thing you want if you are already struggling with RSS overflow.

Tagged with:  

I made a few additions to the Xcode Tutorial and the cocos2d FAQ which are based on user questions and concerns.

Xcode Project Tutorial: How to integrate Chipmunk SpaceManager

How to update the cocos2d-iphone code in a project created with a cocos2d Project Template? (Theory & Advice)

How to fix common Box2d compile errors? (must compile using C++)

How to fix common Chipmunk compile errors? (does not compile with C++ code)

How to draw an endlessly repeating Parallax Background? (very simple, very effective)


On Searching the Tutorial & FAQs

I’m still trying to get the search function on the Tutorial and FAQ pages fixed. Currently it works for the Xcode Tutorial only but other search result links may simply show an Error. I’ll try to get this fixed as fast as i can and i’m getting very helpful support from the folks at ScreenSteps Live so i’m hopeful.

Please also note that the search box in the navigation panel doesn’t search the FAQ and Tutorials, just the blog and pages.

Tagged with:  

Xcode Project Tutorial Updates: Box2d & Template

On May 12, 2010, in Announcements, by Steffen Itterheim

If you followed my Xcode Project Tutorial or received it after signing up for my Newsletter you may have noticed that it would not compile if you added #import “box2d.h” to any of your classes. I investigated and thanks to your comments the problem was easy to fix. I wrote a Tutorial lesson detailing box2d integration issues and how to solve them.

In addition, Tim Soliday who blogs at FatFingerStudios.com went through the effort of creating a “real” Xcode Template from my Tutorial project. By “real” i mean an Xcode Template that will be added to Xcode’s “File -> New Project” list of applications so that you can choose to start with a “cocos2d Application from there. This has also been requested by readers. I added another Tutorial lesson which describes how to install Tim’s Xcode Template.

I will add Tim’s Xcode Template to the Newsletter welcome mail in a couple minutes so new Newsletter subscribers will receive it automatically! If you have already signed up for my Newsletter you’ll have it in your inbox shortly, you do not have to sign up again!

The new Projectfiles you’ll receive also contain the box2d fixes and include my free source code collection and a number of other changes. Most notably the addition of License files and folder structure that go along with it which help me and my customers to differentiate between my base source code that is only licensed to the customer vs. source code that is later fully owned by my customers. Feel free to disregard or delete these License files if you have no use for them.

Tagged with:  

Issues with Images & PDF downloads

On May 10, 2010, in Announcements, by Steffen Itterheim

I keep getting reports from users who either don’t see images on some lessons of the Tutorial and FAQs or who can’t download the Manual/Lesson PDF files.

The broken images usually fix themselves if you hit the reload button in your browser. You may have to wait a few minutes though. I’m still looking into what’s causing this. For the time being i have disabled the WordPress QuickCache plugin as i suspect it may have something to do with it.

If you can not download the PDF files and instead you get an error message which is formatted in XML like this:

This is because the links to the PDF files expire some time after you have loaded the webpage. A PDF link normally looks something like this:

Amazon’s S3 service will expire such a link after some time. Please do not share direct download links to the manual/lesson PDF files since they will expire, instead link to the lesson itself. If you have problems downloading the PDF, please reload the page and try downloading the PDF again.

I’m sorry about the inconveniences this is causing some of you.

Tagged with:  

This is worth pointing out: paulsondev (who unfortunately has no About page on his blog, hint hint ;)) posted a 90-minute (!) Tutorial about creating a scrolling Tilemap with TMX and cocos2d for iPhone! I haven’t watched it but anyone who is dedicated to make a 90 minute development video deserves attention. And as far as i can tell it’s pretty cool. Plus he uses the same desktop background as i do. :)

Tagged with:  
Page 3 of 41234
Powered by WishList Member - Membership Software