Cocos2d-x mobile games getting started

Source: Internet
Author: User

Cocos2d-x mobile games getting started

I. Why should I write this article?

Cocos2d-x game engine has been out N years, online tutorials a pile of, But why so two I want to write an entry navigation? Isn't the blind lamp useless wax? After giving you so many questions, let's answer them.

The entry navigation article is not for Daniel and experts, but for the next entry of our team's newcomers. In this blog, we need to make a navigation for the newcomers, at the same time, I also use this navigation blog to test whether new users are willing to move to the mobile application field. Mobile Internet is already booming, except for games, which are currently the most popular applications. Of course, mobile games are steadily improving. Although I don't know when mobile games will become dull, but at least now it seems to be a good prospect. With the next introduction of the new users to start the game engine cocos2d-x, the test of their newcomers are willing to do a career in the mobile application field.

2. Introduction to cocos2d-x Engine

What is a cocos2d-x engine? Why is it an engine?

As the name suggests, an engine is an automobile engine. It is like a human heart. All power of the human body and power of the automobile are derived from the engine, with the engine, you can easily build the mechanical equipment you want (without worrying about the domestic mechanical engine development capabilities ), of course, the engine here is only a technical meaning of the mechanical engine, and it is not something that can be seen and touched by physical objects. The game engine is the heart of a game. With the engine, you can build your applications in the shortest time and use the convenient features in the engine to easily implement the game functions you want.

Cocos2d-x game engine as the current domestic mobile game engine share the first engine, have to say that its huge advantages have been rapid development capabilities. With the cocos2d-x engine you can easily achieve cross-platform (cross-platform do not know what it means? Juvenile, Baidu). It's no exaggeration to write it once and run it everywhere.

As the entry navigation of the game, next I will introduce the cocos2d-x development of the general model of the game and the operation process.

Iii. Introduction to engine development games

In the cocos2d-x game engine, the use of node tree structure to manage the game, a game only one director to manage each part of the game, A game can be divided into different scenarios? Young man, think about how movies are shot. A scene can be divided into different layers (not understanding the layers in the game? You should know about movie footage. A layer can have any visible game Node (that is, the object. All the classes in the game inherit from the Node class Node ).

The following is a diagram of each concept:


Director -- DirectZ success? http://www.bkjia.com/kf/ware/vc/ "Target =" _ blank "class =" keylink "> encryption + PHN0cm9uZz7Su7/Audio/audio + audio/T0Lj8x7 + audio + a74bautcSjqbPpz/audio + audio /examples + 3s6G + examples/examples + CjxwPjxzdHJvbmc + examples + 086 Ossru/examples + examples/cSjyr2jrM/examples + examples + signature + CjxwPjxzdHJvbmc + s6G + signature/Signature + signature/qKGisOa/Signature + signature + zbTT0/Signature + signature + zcrHwfezzL/Signature + sLXEwt + signature + Signature + response/response + 62 s/response + response/response + CjxwPjxzdHJvbmc + response/response + sLjJybbE2KO/response + PE2KGjs6G + sn7ysftzs + response + 31tDP1Mq + release + yc/release/m/tLW9tcTTzs + release/release + s/release/qOsscjI57Slw/release/uPay49bQy/nVucq + authorization/nT0LLjtf6808bwwLS/authorization + zbm5s8nBy9K7uPbN6tX7tcTTzs + 3vefD5qOsz8LD5sC0v7TSu8/authorization =" http://www.2cto.com/uploadfile/Collfiles/20140911/20140911091415119.png "Alt =" ">

Three Layers Layer1, Layer2, and Layer3 are displayed on the top of the stack. The Layer1 layer is located at the bottom of the stack, and Layer3 is located at the top of the stack, both Layer1 and Layer2 are blocked. This is the effect of the layer. The top layer shows all of them, and the following layers are blocked in sequence. Each layer has its fixed content, which is used to separate different elements in the game in order to facilitate the management of a certain kind of things. For example, the plants in the game are a layer, all the logical relationships and representations of plants are in this layer. Even if a problem occurs on this layer, it is only a problem on this layer and will not affect other elements in the game. The separate layer is modular, which facilitates management and development by many people.


Sprite

The layer is introduced above, but the concept of a light layer does not have an object in the layer to form a game. All the things in the game that can move or have specific behaviors are called Sprite, sprite allows you to move, rotate, scale, execute an animation, and display other effects.

The most typical Sprite is like a hero in Dota. Every hero is an independent genie. Players can control the actions of the genie through input events in the layer, such as jumping, or launching bullets. The genie is the smallest unit in the game and the most flexible thing in the game. The quality of the game is almost displayed by the genie, just like the actors in the movie. All the things seen in the game are generated by pictures, and the genie is no exception. Anyone who knows about cartoons should know that cartoons are displayed by a group of pictures for quick play, the same is true for Genie. Different Combinations of images can have different effects. The quality of a game depends to the maximum extent on the creation of images. It can be said that the key to the success or failure of a game lies in the artist, show users well, users like it, otherwise your game will fail, even if the strategy is good, it will be useless.


The above describes the four most basic elements in the game. It is far from enough for a game to have such knowledge. However, the basic composition of each game is like this, but the intermediate implementation effects are different, as an introduction to the cocos2d-x game engine entry, is also a test of the first level of the new users of the content, the above introduction is enough, as a newcomer to read the above things, you should think about a few small questions. Otherwise, when the boss asks you, you may be confused. What is the problem? This requires self-mining from the text.

Well, as an entry to the cocos2d-x, Daniel and master can float, was not prepared for these people, the above introduction has no place, the villain's ability is limited, it can only be introduced here.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.