万本电子书0元读

万本电子书0元读

顶部广告

Cocos2d Cross-Platform Game Development Cookbook - Second Edition电子书

售       价:¥

0人正在读 | 0人评论 9.8

作       者:Siddharth Shekar

出  版  社:Packt Publishing

出版时间:2016-02-22

字       数:260.6万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Develop games for iOS and Android using Cocos2d with the aid of over 70 step-by-step recipesAbout This BookLearn to efficiently use Cocos2d to develop cross-platform games, and have them work on iOS as well as AndroidGet acquainted with industry-wide professional tools such as Glyph Designer, Texture Packer, and Physics Editor, as well as using the Swift/ Sprite builder implementation of Cocos2dUse the easy-to-follow recipes to develop as well as deploy games to the Playstore and the App StoreWho This Book Is ForThis book is for intermediate game developers and especially the ones who are generally curious to find out what’s new in Cocos2d v 3.3.What You Will LearnBuild custom sprites with custom animations for the gameBuild interactivity into your game by adding gestures and touch interactionsUnderstand AI enemy programming and path finding to make games more excitingAdd physics to your game to make it more lively and interactiveGet familiar with the Swift and Sprite builder implementations along with Objective-C programmingPerform hassle-free deployment of games built in iOS onto AndroidAdd effects and particle systems to make the game more colorfulIn DetailCocos2d is the world’s leading game development framework for developing iOS games. With the introduction of Swift and Spritebuilder, it has become easier than ever to develop the games of your dreams without much effort. With Cocos2d, you can also deploy the game on Android, thereby maximizing profit and reducing development and porting costs.The book starts off with a detailed look at how to implement sprites and animations into your game to make it livelier. You will then learn to add scenes to the game such as the gameplay scene and options scene and create menus and buttons in these scenes, as well as creating transitions between them. From there on, you will get an understanding of how to program user interactions such as tapping, holding, and swiping. You’ll then add accelerometer inputs and physics to the scene, and make objects respond back to the inputs. A game is practically incomplete without audio being added, so this will be covered next.The next section will include ways to add Artificial Intelligence to enemies in the game, allowing them to patrol, chase, and shoot in a projectile manner. You will then learn to use NSUserDefault to save and load game progress, and create and access files using JSON, Plist, and XML files for custom storage and retrieval of data. Then you will learn to add dynamic lighting to your game and will use industry-wide tools such as Texture Packer, Glyph Designer, Physics Editor, Particle Designer, and Sprite Illuminator to create more visually appealing and performance-optimized games.Towards the end of the book, we dive into Apple’s latest programming language—Swift, highlighting the major differences between Objective C and Swift. The book culminates with taking your existing game developed for iOS and porting it to Android, showing you how to install the Android Xcode plugin as well.Style and approachThe book is written in an extremely lucid and step-by-step manner; it can be understood easily by anyone. The topics included are broken down into individual chapters so you can refer to the specific chapter to get answers on the subject you are interested in.
目录展开

Cocos2d Cross-Platform Game Development Cookbook Second Edition

Table of Contents

Cocos2d Cross-Platform Game Development Cookbook Second Edition

Credits

About the Author

Acknowledgments

About the Reviewers

www.PacktPub.com

eBooks, discount offers, and more

Why Subscribe?

Preface

What this book covers

What you need for this book

Who this book is for

Sections

Getting ready

How to do it…

How it works…

There's more…

See also

Conventions

Reader feedback

Customer support

Downloading the example code

Downloading the color images of this book

Errata

Piracy

Questions

1. Sprites and Animations

Introduction

Downloading and installing Cocos2d

Getting ready

How to do it…

How it works…

The 2D coordinate system

Getting access to MainScene

Getting ready

How to do it…

How it works…

Adding sprites to scenes

Getting ready

How to do it…

How it works…

Creating a sprite using RenderTexture

Getting ready

How to do it…

How it works…

There's more…

Creating a custom sprite class

Getting ready

How to do it…

How it works…

Animating sprites

Getting ready

How to do it…

How it works…

Adding actions to sprites

Getting started

How to do it…

How it works…

There's more…

Drawing glPrimitives

Getting ready

How to do it…

How it works…

There's more…

Adding the parallax effect

Getting ready

How to do it…

How it works…

2. Scenes and Menus

Introduction

Adding a MainMenu Scene

Getting ready

How to do it…

How it works…

Adding text using CCLabel

Getting ready

How to do it…

How it works…

There's more…

Adding buttons with CCMenu

Getting ready

How to do it…

How it works…

Adding a Gameplay Scene

Getting ready

How to do it…

How it works…

Transitioning between scenes

Getting ready

How to do it…

How it works…

There's more…

Adding transition effects

Getting ready

How to do it…

How it works…

There's more…

Adding a Level Selection Scene

Getting ready

How to do it…

How it works…

Scrolling a Level Selection Scene

Getting ready

How to do it…

How it works…

3. Gestures, Touches, and the Accelerometer

Introduction

Understanding swipe

Getting started

How to do it…

How it works…

There's more…

Implementing tap

Getting started

How to do it…

How it works…

Adding LongPress

Getting ready

How to do it…

How it works…

Adding pinch/zoom controls

Getting ready

How to do it…

How it works…

Adding rotation objects

Getting ready

How to do it…

How it works…

Adding panning

Getting ready

How to do it…

How it works…

Including touches

Getting ready

How to do it…

How it works…

Creating objects with touchBegan

Getting ready

How to do it…

How it works…

There's more…

Moving objects with touchMoved

Getting ready

How to do it…

How it works…

Customizing touches in the sprite class

Getting ready

How to do it…

How it works…

Adding an accelerometer

Getting ready

How to do it…

How it works…

Adding a directional pad

Getting ready

How to do it…

How it works…

There's more…

4. Physics

Introduction

Adding physics to a game scene

Getting started

How to do it…

Adding physics objects

Getting started

How to do it…

How it works…

Looking at different body types

Getting started

How to do it…

How it works…

Adding sprite texture to physics objects

Getting started

How to do it…

How it works…

Creating composite bodies

Getting started

How to do it…

How it works…

Creating complex shapes

Getting started

How to do it…

How it works…

Changing body properties

Getting started

How to do it…

How it works…

There's more…

Applying impulse with the touch control

Getting started

How to do it…

How it works…

Applying force with the accelerometer

Getting started

How to do it…

How it works…

Collision detection

Getting started

How to do it…

How it works…

Adding revolute joints

Getting started

How to do it…

How it works…

Adding motor joints

Getting started

How to do it…

How it works…

Adding a game loop and scoring

Getting ready

How to do it…

How it works…

5. Audio

Introduction

Adding background music

Getting ready

How to do it…

How it works…

Adding audio effects

Getting ready

How to do it…

How it works…

Adding a mute button

Getting ready

How to do it…

How it works…

Adding a volume slider

Getting ready

How to do it…

How it works…

Adding a pause and resume button

Getting started

How to do it…

How it works…

6. AI and A* Pathfinding

Introduction

Patrol enemy behavior

Getting ready

How to do it…

How it works…

Projectile shooting enemy

Getting ready

How to do it…

How it works…

Chasing enemy behavior

Getting ready

How to do it…

How it works…

A* pathfinding

Getting ready

How to do it…

How it works…

7. Data Storage and Retrieval

Introduction

Loading the XML file data

Getting started

How to do it…

How it works…

Saving to the XML file data

How to do it…

How it works…

Loading the JSON file data

Getting ready

How to do it…

How it works…

Loading the PLIST file data

Getting ready

How to do it…

How it works…

Saving the PLIST file data

Getting ready

How to do it…

How it works…

Using NSUserDefaults

How to do it…

How it works…

8. Effects

Introduction

CCEffects

Getting ready

How to do it…

Adding the bloom effect

Adding the blur effect

Adding the brightness effect

Adding the drop shadow effect

Adding the pixelate effect

Adding the stack effect

How it works…

Adding the glass effect

Getting ready

How to do it…

How it works…

Adding the motion streak effect

Getting ready

How to do it…

How it works…

Adding the particle effect

Getting ready

How to do it…

How it works…

There's more…

Adding 2D lighting

Getting ready

How to do it…

How it works…

There's more…

9. Game Tools

Introduction

Glyph Designer

Getting ready

How to do it…

How it works…

Particle system

Getting ready

Particle Designer

Emitter configuration

Particle Settings

Color settings

Texture settings

Particle2dx

Motion

Color&Shape

Template

Export

How to do it…

How it works…

TexturePacker

Getting ready

Data

Texture

Layout

Sprites

How it works…

PhysicsEditor

Getting ready

How to do it…

How it works…

10. Swift/SpriteBuilder Basics

Introduction

Implementing the Swift syntax

Getting started

How to do it…

Variables

Operators

Arithmetic operators

Comparison operators

Logical operators

Arithmetic increment/decrement and assignment operations

Control flow statements

Decision making statements

The if statement

The if else statement

The else if statement

The conditional expression

The switch statement

Looping statements

The while loop

Repeating the while loop

The for loop

The for in loop

Arrays

Looping through arrays

Adding, removing, and inserting objects in arrays

Important array functions

Dictionary

Adding and removing objects in a dictionary

Looping through items in a dictionary

Dictionary functions

Functions

Simple functions

Passing a parameter

Passing more than one parameter

Returning a value

Default and named parameters

Returning more than one value

Classes

Properties and initializers

Custom methods

Inheritance

Access specifiers

Optionals

Implementing Cocos2d Swift

Getting ready

How to do it…

How it works…

SpriteBuilder basics

Getting ready

How to do it…

How it works…

11. Porting to Android

Introduction

Installing the Android Xcode plugin

Getting started

How to do it…

Enabling USB debugging on a device

How to do it…

Running the SpriteBuilder project on a device

How to do it…

Porting a project to Android

How to do it…

No Java runtime error

How to do it…

Provision profile error

How to do it…

Blank screen error

How to do it…

Useful resources

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部