Game Development Reference
In-Depth Information
I've also seen a fair bit of other developers' cocos2d code and followed the discussions
on code design, structure, and style. I base my code samples on a framework that relies
on composition over inheritance and explain why this is preferable. One other frequent
question that has to do with code design is how different objects should communicate
with each other. There are interesting pros and cons for each approach to code design
and structure, and I want to convey these concepts because they help you write more
stable code with fewer bugs and better performance.
What iOS App Developers Will Learn
So, you're an iOS app developer, and you've worked with the iOS SDK before? Per-
fect. Then you'll be most interested in how making games work in a world without In-
terface Builder. In fact, you'll be using other tools. They may not be as shiny as
Apple's tools, but they're useful nonetheless.
The programming considerations will change, too. You don't normally send and re-
ceive a lot of events in game programming, and you let a larger number of objects de-
cide what to do with an event. For performance reasons and to reduce user input
latency, game engine systems often work more closely connected with each other. A lot
of work is done in loops and update methods, which are called at every frame or at spe-
cific points in time. Whereas a user interface-driven application spends most of its time
waiting for a user's input, a game keeps pushing a lot of data and piXEls behind the
scenes, even when the player is not doing anything. So there's a lot more going on, and
game code tends to be more streamlined and efficient because of concerns for perform-
ance.
What Cocos2d Developers Will Learn
You're already familiar with cocos2d? You may be wondering whether you can learn
anything new from this topic. I say you will. Maybe you want to skip the first chapters,
but you'll definitely get hooked by the games' sample source code supplied with the
topic. You'll learn how I structure my code and the rationale behind it. You'll probably
find inspiration reading about the various games and how I implemented them. You'll
also benefit from a good number of tips and you'll learn how Kobold2D helps you de-
velop games faster.
Search Nedrilad ::




Custom Search