Rapid Game Development Using Cocos2d-JS
An end-to-end guide to 2D game development using JavaScript
Book
Chapter
Understanding the architecture of Cocos2d-js will give you a solid foundation for understanding the overall framework. This section will not cover the detailed architecture, which is beyond the scope of this b...
Chapter
Handling user input is an essential part of any game. In Cocos2d-js, user input, such as by touch, mouse, or keyboard, is available in the form of events. There are three major parts involved in the event mech...
Chapter
Animation is essential to any good game, as it makes your game cool and visually appealing, and helps you to acquire more users. A visually appealing game markets itself. Take a moment to look at the top-gross...
Chapter
To draw primitive shapes, cc.drawNode is used. This node type has functions like drawCircle, drawPoly, drawRect, drawSegment, etc. Let’s look at an example:.
Chapter
In the early days, games were hard to make, but in recent years lots of 2D and 3D frameworks and tools have evolved that simplify game development and enable developers to produce high-quality games quickly. C...
Chapter
Sprites are the most essential part of any 2D game. You will be dealing with this entity often while develo** 2D games. In Cocos2d-js, this entity is defined by a class called cc.Sprite. In this section, we ...
Chapter
A GUI is another essential part of any game. It shows the HUD display, score, any required text, and buttons such as play and pause. Cocos2d-js has pre-defined node types to represent such GUI elements. Let’s ...
Chapter
In physics-based games, simulating the physics of the real world is very important. There are a variety of physics engines available today. The most popular one for Cocos2d-js is Chipmunk physics. This was ori...