I’m done writing the Tome of SpriteBuilder.
There’s only edits and reviews left, page proofing and then it goes out to print. Meanwhile, I’m cleaning up and extending the Bouncy Beast project for its App Store release.
Time to share some insights as I haven’t been able to slice some time off to write about the process as I originally intended to.
What’s in the book?
The book will guide you through the creation of a physics-driven, parallax-scrolling game with the help of SpriteBuilder, Cocos2D (cocos2d-swift) and Objective-C. The level-based structure will enable you to add more content to the game, even without writing additional code.
As your guide I will walk you through the individual steps necessary to create the game project. Along the way I’ll explain the SpriteBuilder features, caveats, workarounds and helpful tips and tricks as you are most likely to come across or need them.
At the end you’ll have a complete game reminiscent of games like Badland.
The game also runs on Android devices thanks to Apportable’s Android plugin for SpriteBuilder.
The Bouncy Beast project’s source code will be available.
Bouncy Beast Demo Video
Here’s a video demonstrating the game. Notice the subtle particle effect on the main menu’s background, the paginating scroll view, the soft-body player character.
NOTE: the suboptimal framerate in the video is 100% attributable to the iOS Simulator from which I recorded the video. On an iPod touch 5G the game runs with a constant 60 fps.
Because I expect this question: no, Swift does not play a role in this book. All code is Objective-C only.
When I started writing this book, Swift wasn’t even known. It took some more time for Cocos2D to support Swift and SpriteBuilder will get the ability to create Swift projects starting with v1.3.
Nevertheless, most of the things you’ll learn about SpriteBuilder directly apply to Swift projects, too. Only the code needs porting.
Beginning and experienced game developers who want an introduction to and learn to make games with SpriteBuilder.
The book was built and tested with SpriteBuilder v1.3 and cocos2d-swift v3.3 (both currently in beta) as well as Xcode 5.1 and 6.0. That means by the time the book is available it will cover the most up-to-date versions of SpriteBuilder and Cocos2D.
I’ve taken care to avoid anything obviously version-specific or prone to change. The book’s contents should still be applicable a year from now. In any case there will be errata in case a new version of either SpriteBuilder, Cocos2D or Xcode may introduce any incompatibilities with the book.
Table of Contents
Following is a list of chapters in this book with short summaries.
- Chapter 1 – Introduction
- Chapter 2 – Laying the Groundwork
- Chapter 3 – Controlling and Scrolling
- Chapter 4 – Physics and Collisions
- Chapter 5 – Timelines and Triggers
- Chapter 6 – Menus and Popovers
- Chapter 7 – MainScene and GameState
- Chapter 8 – Selecting and Unlocking Levels
- Chapter 9 – Physics Joints
- Chapter 10 – Soft-Body Physics
- Chapter 11 – Audio and Labels
- Chapter 12 – Visual Effects and Animations
- Chapter 13 – Porting to Android
- Chapter 14 – Debugging and Best Practices
An introduction to SpriteBuilder and its user interface. The most commonly needed tasks are explained here. Also contains a quick introduction to programming with Cocos2D. You end up with a project that allows you to transition between scenes by the press of a button.
You’ll add touch input and parallax scrolling of multiple background layers in this chapter. You’ll learn to use sprite sheets and prefabs. A player prefab is introduced, its simplistic movement is performed by move actions.
You learn how to add physics to a game, specifically immovable, impenetrable walls as well as dynamic bodies. Player movement is replaced by actual physics. Collision callback methods are used to trigger the level exit. How to enable physics debug drawing is also explained.
Timelines are explained in depth, then used to animate rotating physics objects. You’ll learn how to create trigger areas that run code when the player enters them. The resulting project now makes simple physics interactions possible.
A powerful, yet easy way to create popover menus such as the pause and game over menus is explained. The same concept can be used to create fullscreen menus without interrupting the running scene. The menus are animated with the Timeline, using Timeline delegate methods to receive notifications when a Timeline has ended.
The main menu is designed with an animated background and a settings menu with audio volume sliders. A GameState class is introduced which stores global, user-specific game data via NSUserDefaults.
A level selection screen is added with the help of the Scroll View node. How CCScrollView works and how it can be programmed and how you can respond to its delegate methods is carefully explained. The level selection pages are divided into multiple worlds, with each level unlocked by completing the previous level.
An entire chapter dedicated to creating physics objects out of joints, specifically chains, ropes and springs. How joints work and what you can and probably shouldn’t do with them is explained in detail.
The player prefab is replaced by a soft-body player. A soft body object is a deformable physics object held together by joints, its collision shape divided into multiple smaller bodies. This chapter also introduces custom rendering with Cocos2D as the player’s texture needs to be drawn to match its deformed shape at any time.
You’ll learn how to play short sound effects with the Timeline and programmatically with ObjectAL, and background music. The other half of the chapter deals with Label TTF properties like shadows and outline but also explains how to create, import and use bitmap fonts in SpriteBuilder.
You’ll be creating a sprite frame animation for the first time, and make it work with the player’s custom rendering class. An introduction to Particle Effect nodes is mandatory in a chapter on visual effects. This culminates in the use of the Effect Node, which are essentially shader programs that you can add and design in SpriteBuilder. At the end of this chapter you’ll hardly recognize the main menu scene.
At first you’ll see what is necessary to develop for Android. Then you’ll create a new project with which you’ll test deployment to an Android device. Finally you’ll convert the Bouncy Beast project and fix any compilation, launch and layout issues that occur. You’ll get advice on how to best approach cross-platform development with SpriteBuilder.
This chapter is an introduction to debugging with Xcode and Cocos2D. You’ll learn about techniques to catch or prevent programming bugs. Basically a self-help guide that’ll quickly proof invaluable. There’s also a section on Troubleshooting some of the most common SpriteBuilder and Cocos2D issues.
|Follow @gaminghorror||Follow @kobold2d|