Learning Cocos2d-JS Game Development
eBook - ePub

Learning Cocos2d-JS Game Development

Emanuele Feronato

Buch teilen
  1. 188 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Learning Cocos2d-JS Game Development

Emanuele Feronato

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

Complete TIS Desc (HTML)

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Learning Cocos2d-JS Game Development als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Learning Cocos2d-JS Game Development von Emanuele Feronato im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Ciencia de la computación & Programación de código abierto. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

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...

Inhaltsverzeichnis