Learning Cocos2d-JS Game Development

Learn to create robust and engaging cross-platform HTML5 games using Cocos2d-JS
Preview in Mapt

Learning Cocos2d-JS Game Development

Emanuele Feronato

Learn to create robust and engaging cross-platform HTML5 games using Cocos2d-JS
Mapt Subscription
FREE
$29.99/m after trial
eBook
$12.60
RRP $17.99
Save 29%
Print + eBook
$29.99
RRP $29.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$12.60
$29.99
$29.99 p/m after trial
RRP $17.99
RRP $29.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


Learning Cocos2d-JS Game Development Book Cover
Learning Cocos2d-JS Game Development
$ 17.99
$ 12.60
Building Android Games with Cocos2d-x Book Cover
Building Android Games with Cocos2d-x
$ 19.99
$ 14.00
Buy 2 for $26.60
Save $11.38
Add to Cart

Book Details

ISBN 139781784390075
Paperback188 pages

Book Description

Whether you are new to game development or an experienced developer, you will be surprised by how easy it is to create HTML5 cross-platform games with Cocos2d-JS. In this book, you will use JavaScript to create spectacular and exciting games of different genres.

Without any dreary theory, which often discourages technical book readers, each chapter will guide you through the creation of different games, each packed with new and exciting features.

You will begin by learning the basics of a cross-platform game. You'll also learn to animate, rotate, scroll, and tween sprites. You will learn to make your game more enticing by adding your own special touch using features such as music, sound effects, and physics. You'll also learn to protect, sitelock, export, and publish the games you have created. By the end of the book, you'll have created a complete cross-platform game right from scratch, featuring leader boards and third-party adverts, complete with the final polish every game should require.

Table of Contents

Chapter 1: Hello World – A Cross-platform Game
Why should I make cross-platform games?
What Cocos2d-JS is and how it works
The structure of your Cocos2d-JS project
Hello Cross-World
Preloading and adding images
Removing images and changing the background color
Summary
Chapter 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
Changing sprite images on the fly
Shuffling the tiles and adding the score
Summary
Chapter 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
Chapter 4: Learn about Swipes through the making of Sokoban
Loading graphic assets
Building a level
Detecting swipes
Completing the game
Summary
Chapter 5: Become a Musical Maestro
Choosing sounds
Preloading sounds
Creating a sound menu
Managing music and sound effects
Summary
Chapter 6: Controlling the Game with Virtual Pads
Overview of virtual pads
First things first – the game
Summary
Chapter 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
Chapter 8: Adding Physics to Your Games Using the Chipmunk2D Engine
Adding the Chipmunk2D engine to your project
Configuring the physics space
Adding bodies to the space
Selecting and destroying space bodies
Checking for collisions among bodies
Using your own graphic assets
Summary
Chapter 9: Creating Your Own Blockbuster Game – A Complete Match 3 Game
Setting up the game
Where to go now
Summary

What You Will Learn

  • Discover the basics behind each game genre, from endless runners to puzzles, and from physics games to match games
  • Target different resolutions, screen sizes, screen ratios, and deal with landscape and portrait screens
  • Place and move sprites on the screen, using scrolling and tweening for smooth movements
  • Enhance your game by adding sound effects and background music
  • Create physics-driven games with unmatched realism
  • Create and destroy bodies with a single touch while managing forces, collisions, and gravity
  • Improve your game's visual appeal by adding particles to generate explosions, fire trails, and other appealing effects
  • Manage resources and save memory by packing all your graphic assets in a single file

Authors

Table of Contents

Chapter 1: Hello World – A Cross-platform Game
Why should I make cross-platform games?
What Cocos2d-JS is and how it works
The structure of your Cocos2d-JS project
Hello Cross-World
Preloading and adding images
Removing images and changing the background color
Summary
Chapter 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
Changing sprite images on the fly
Shuffling the tiles and adding the score
Summary
Chapter 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
Chapter 4: Learn about Swipes through the making of Sokoban
Loading graphic assets
Building a level
Detecting swipes
Completing the game
Summary
Chapter 5: Become a Musical Maestro
Choosing sounds
Preloading sounds
Creating a sound menu
Managing music and sound effects
Summary
Chapter 6: Controlling the Game with Virtual Pads
Overview of virtual pads
First things first – the game
Summary
Chapter 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
Chapter 8: Adding Physics to Your Games Using the Chipmunk2D Engine
Adding the Chipmunk2D engine to your project
Configuring the physics space
Adding bodies to the space
Selecting and destroying space bodies
Checking for collisions among bodies
Using your own graphic assets
Summary
Chapter 9: Creating Your Own Blockbuster Game – A Complete Match 3 Game
Setting up the game
Where to go now
Summary

Book Details

ISBN 139781784390075
Paperback188 pages
Read More

Read More Reviews

Recommended for You

Building Android Games with Cocos2d-x Book Cover
Building Android Games with Cocos2d-x
$ 19.99
$ 14.00
Cocos2d-x by Example: Beginner's Guide - Second Edition Book Cover
Cocos2d-x by Example: Beginner's Guide - Second Edition
$ 35.99
$ 25.20
Cocos2d Cross-Platform Game Development Cookbook - Second Edition Book Cover
Cocos2d Cross-Platform Game Development Cookbook - Second Edition
$ 39.99
$ 28.00
Learning C# by Developing Games with Unity 5.x - Second Edition Book Cover
Learning C# by Developing Games with Unity 5.x - Second Edition
$ 35.99
$ 7.20
Multiplayer Game Development with HTML5 Book Cover
Multiplayer Game Development with HTML5
$ 23.99
$ 16.80
Cocos2D Game Development Essentials Book Cover
Cocos2D Game Development Essentials
$ 17.99
$ 12.60