Book Image

Python Game Programming By Example

Book Image

Python Game Programming By Example

Overview of this book

Table of Contents (14 chapters)
Python Game Programming By Example
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Getting started with cocos2d


As with any other framework, cocos2d is composed of several modules and classes that implement different features. In order to develop applications with this API, we need to understand the following basic concepts:

  • Scene: Each of the stages of your application is a scene. While your game may have many scenes, only one is active at any given point in time. The transition between scenes defines your game's workflow.

  • Layer: Every sheet contained in a scene, whose overlay creates the final appearance of the scene, is called a layer. For instance, your game's main scene may have a background layer, an HUD layer with player information and scores, and an animation layer, where events and collisions between sprites are being processed.

  • Sprite: This is a 2D image that can be manipulated though cocos2d actions, such as move, scale, or rotate. In our games, sprites will represent the player's character, enemies, and visual information, such as the number of lives left...