We start the journey of game development in Cocos2d-x with a simple, fun, and colorful game. Let's call it ColourSmash. This will serve as a revision of the basic features of the engine and will get us started with some fun development. We will be using the HTML5 version of Cocos2d for this project—Cocos2d-html5-v2.2.3
to be specific. So all the coding in this chapter, and the next, will be done in JavaScript.
Here's what you'll learn in this chapter:
cc.Scene
and cc.Layer
The game we will discuss here is one of the many famous puzzle games found online. The basic idea of the game is simple: click on a colored tile and all adjacent tiles of the same color disappear. As you may have guessed, the game world consists of a set of colorful tiles. You keep clicking tiles and they disappear. What makes it fun is a bunch of tiles disappearing together yields you a bonus!
This is a glimpse of what we should have at the end of this chapter:
3.129.72.176