Book Image

Learning iPhone Game Development with Cocos2D 3.0

By : Kirill Muzykov
Book Image

Learning iPhone Game Development with Cocos2D 3.0

By: Kirill Muzykov

Overview of this book

Table of Contents (19 chapters)
Learning iPhone Game Development with Cocos2D 3.0
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 4. Rendering Sprites

In this chapter, we'll start building our sample game called Cocohunt. We'll start by creating the Xcode project skeleton and adding the GameScene class to the project. Then, we'll start filling the empty GameScene scene with the actual game objects. We will add the most common type of objects used in games—sprites. We'll learn their main properties, such as position and anchor point. We will make them move and will even add an animation.

The goal of this chapter is to learn how to work with sprites and get to know their main properties. After reading this chapter, you will be able to add sprites to your games.

In this chapter, we will cover the following topics:

  • Setting up the initial project

  • Sprites and their main properties

  • Adding sprites to the scene

  • Adding sprites as a child node of another sprite

  • Manipulating sprites (moving, flipping, and so on)

  • Performance considerations when working with many sprites

  • Creating spritesheets and using the sprite batch node to...