Cocos2d-x-3.6 engine overview, cocos2d-x-3.6 Overview

Source: Internet
Author: User

Cocos2d-x-3.6 engine overview, cocos2d-x-3.6 Overview

Cocos2d-x is a game development engine, from the release to now also has year 56, along the way to see it grow slowly. It is one of the most widely used open-source 2d engines. It is said that it has occupied 90% of the market. Therefore, it is necessary for children's shoes who want to develop games.

So the question is, what is a game engine?

If a programmer writes Android and ios applications and wants to turn to game development through self-learning, he must first find out the problem. Otherwise, he will be stuck in his mind and will not be able to learn it later. To learn a thing, you must first understand its nature, rather than simply using it.

The car engine and airplane engine are easy to understand and understand in your life. You can see and feel it. You don't need to explain it. An automobile engine can be understood as an engine, the core of an automobile. the power system of the whole automobile is the heart of an automobile.

How can we understand the game engine.

A car without an engine may look like a car, but it looks like a car, just like a pile of scrap iron.

This is not the case for a game engine. To develop a game, you can use the engine or do not use the engine. After development, it is a game. You can use Android app interfaces on Android to develop a java game, anti-tower, continuous playback, and horizontal rpg. Because games are essentially an infinite loop (game loop), and all your logic is in this game loop, you can implement it by yourself without using any engine.

So some people like to make a game engine like a car engine, which I think is incorrect. You tell a newbie that a game engine is like a car engine and a power source. So the question is, I wrote a game without an engine. How can this be understood as a car engine? A car without an engine is a waste of iron.

The game engine should be understood as a set of tools and a framework. An engine like cocos2d-x is a code engine, that is, it provides a large number of encapsulated code, you need to learn how to use each code module to skillfully use. This type of engine has a high learning cost because you need to be familiar with the engine source code. Another type of engine is like Unity3D, which is a highly encapsulated tool engine. The learning cost is lower, because it is more intuitive and upper-level. However, to be proficient in engines, you must have a solid programming skills. Here I only talk about cocos2d-x, have the opportunity to talk about Unity3D later.

Cocos2d-x is actually a development framework. You don't need it. There is no essential difference between games. The difference lies in the development process. For example, in Android, you can also write a video connection scenario. If you do not use an engine, you may need to write a view on your own to calculate the visible area and calculate the size of each square according to the visible area, put an image in each cell and call the onDraw method to redraw the image. In this way, the development of a continuous view is related to the Android platform, because you use the upper-layer API of the android application framework, this game cannot be directly transplanted to the ios platform. Similarly, if you develop a game like this with oc on the ios platform, it is related to the ios platform and you cannot transplant it to the Android platform. However, if you use the cocos2d-x engine, you need to be familiar with the concept of a scenario in the engine, the concept of the genie, the concept of the node, and then use the engine method to organize these small elements, is a game scenario. The game developed at this time can be transplanted to multiple platforms.

Why?

This is the power of the cocos2d-x engine. As mentioned above, the engine is just a framework, and it does not seem very different to use it or not. But not. As you know, games are nothing more than an application that organizes images and sounds together in a certain logic. Each platform has its own organizational structure. For upper-layer developers of each platform, you have followed the organizational structure of this platform, the developed game certainly cannot run on another platform because it does not follow the organization of another platform. If there is an organizational method that is common to all platforms, isn't it possible to develop a game with an exaggerated platform. Yes, cocos2d-x is such an organization. The engine will do a lot of basic work, such as how to display an image on the screen, how to play the sound, how to transition the screen, and how to make special effects. All the elements in the game will be encapsulated into complete implementations. You only need to use them and do not need to worry about how to implement them. While the cocos2d-x engine has done more, it implements the main loop of the entire game, while providing a lot of small particle code encapsulation, such as example special effects, sound playback, animation effects, you only need to call several functions to implement these functions. We only need to organize the game logic in the main loop to implement the entire game. This process is like a simulated person who gives you a human skeleton, makes muscles, makes hair, and makes blood. You only need to follow the skeleton, make the appropriate flesh and blood to fill the skeleton, and the last simulation person will come out. Besides, why does it span so many platforms is not because it is born like this. Only because it supports standard openGL ES interfaces across platforms, the engine makes some adaptation work for different platforms, so that all platforms use openGL ES to draw images, then use C ++ to implement the underlying logic, so that it can be cross-platform. Said relatively simple, you can see my previous blog, have a more detailed explanation of how cocos2d-x cross Android, win and ios three platform principles.

Finally, the game engine is actually a framework and a corresponding set of code modules. In this framework, using these code modules to implement the game logic will get twice the result with half the effort and finally develop a game.

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.