Learning Cocos2d-JS Game Development
eBook - ePub

Learning Cocos2d-JS Game Development

Emanuele Feronato

Condividi libro
  1. 188 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Learning Cocos2d-JS Game Development

Emanuele Feronato

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

Complete TIS Desc (HTML)

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Learning Cocos2d-JS Game Development è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Learning Cocos2d-JS Game Development di Emanuele Feronato in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Ciencia de la computación e Programación de código abierto. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Learning Cocos2d-JS Game Development


Table of Contents

Learning Cocos2d-JS Game Development
Credits
Foreword
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Hello World – A Cross-platform Game
Why should I make cross-platform games?
What Cocos2d-JS is and how it works
Requirements to run Cocos2d-JS
The structure of your Cocos2d-JS project
Hello Cross-World
Preloading and adding images
Removing images and changing the background color
Summary
2. Adding Interactivity – The Making of a Concentration Game
Creating multiple instances of game assets
Adding a gradient background
Extending the Sprite class beyond its capabilities
Making assets react to clicks and touches
Picking a tile as an initial attempt
Changing sprite images on the fly
Showing the tile picture
Shuffling the tiles and adding the score
Summary
3. Moving Sprites Around the Screen – An Endless Runner
Loading and placing graphic resources
Adding an endless scrolling background
Adding the spaceship
Controlling the spaceship
Adding asteroids
Asteroid versus spaceship collision
Invulnerability
Preventing the spaceship from flying off the screen
Adding particles
Summary
4. Learn about Swipes through the making of Sokoban
Loading graphic assets
Building a level
Detecting swipes
Completing the game
Summary
5. Become a Musical Maestro
Choosing sounds
Preloading sounds
Creating a sound menu
Managing music and sound effects
Summary
6. Controlling the Game with Virtual Pads
Overview of virtual pads
First things first – the game
Controlling the cart with ghost buttons
Controlling the cart with a virtual pad
Controlling the cart just with your finger
Summary
7. Adding Physics to Your Games Using the Box2D Engine
Before you start
Adding the Box2D engine to your project
Configuring the physics world
Adding bodies to the world
Updating sprite position as the world changes
Selecting and destroying world bodies
Checking for collisions among bodies
Summary
8. Adding Physics to Your Games Using the Chipmunk2D Engine
Adding the Chipmunk2D engine to your project
A physics game, without physics
Configuring the physics space
Adding bodies to the space
Updating Chipmunk2D space and using debug draw
Selecting and destroying space bodies
Checking for collisions among bodies
Using your own graphic assets
Summary
9. Creating Your Own Blockbuster Game – A Complete Match 3 Game
Setting up the game
Creating the board
Selecting and deselecting the first globe
Making globez chains
Backtracking
Removing globez
Making the globez fall down
Creating new globez
Bonus – using the drawing API for a visual feedback
Where to go now
Protect your code
Port your game on mobile devices as a native app
Publishing your game
Licensing your game
Staying up-to-date
Summary
Index

Learning Cocos2d-JS Game Development

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: January 2015
Production reference: 1070115
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78439-007-5
www.packtpub.com

Credits

Author
Emanuele Feronato
Reviewers
Pradyumna Doddala
Pavel Goodanets
Marc Estruch Tena
Jialong Zhai
Commissioning Editor
Ashwin Nair
Acquisition Editor
James Jones
Content Development Editor
Samantha Gonsalves
Technical Editor
Parag Topre
Copy Editor
Relin Hedly
Project Coordinator
Sanchita Mandal
Proofreaders
Simran Bhogal
Stephen Copestake
Maria Gould
Ameesha Green
Paul Hindle
Indexer
Rekha Nair
Production Coordinator
Alwin Roy
Cover Work
Alwin Roy

Foreword

Known by developers all over the world, Cocos2d-x has always endeavored to help developers build and port their games on iOS, Android, and many more native platforms. However, not many developers are aware that the Cocos2d-x team also provides an efficient game engine called Cocos2d-JS to assist users developing cross-native and web platform games with only one code base.
The year 2014 has certainly been a big year for Cocos2d-JS. It became more widely adopted by big companies all over the world; we've released a major version—3.0—and combined Cocos2d-html5 and Cocos2d-x JSB (JavaScript Binding) into Cocos2d-JS. It supplies your game with cross-browser and cross-platform capabilities accompanied by complete Cocos2d-x features, complete tool chain support, and simple friendly APIs. Furthermore, we reinvented the workflow for all platforms, providing a consistent development experience for whichever platform you want to distribute it to. As a result, the Code once, run everywhere principle is easily achieved and feels natural in Cocos2d-JS. With one single JavaScript code base, you can run your game on all web browsers and native platforms, including Mac OS, Windows, iOS, and Android. This will allow your game to deliver in almost all channels of distribution for better opportunities.
Today, I'm more than grateful to witness the creation of this extraordinary book. I believe this book will help us by building a bridge to our developers around the world so they can step over the language barrier. I'd love to express my special thanks...

Indice dei contenuti