The preface

It is believed that those who have been involved in game development are no strangers to Cocos Creator and Laya, while those who have just entered the game industry may not be very clear about the difference between Cocos Creator and Laya.

Here we will be the difference between the two carding to you, please watch carefully

First of all, Cocos Creator accounts for more than 50% of the market share of mobile games, and belongs to NO1, a game engine of mobile games. Laya ranks first in the market share of wechat 3D mini-games.

Both have their strengths. In addition, Cocos Creator 3D was released at the end of 2019, aiming to get a piece of the 3D gaming pie. So let me talk about the specific differences between Cocos and Laya.

I. Coordinate system

The coordinate systems are too far apart. Laya is completely based on the upper left corner of the screen as the origin of coordinates, x to the right and Y to the down. However, the Cocos Creator coordinate system is the same as the OpenGL coordinate system, the origin is the lower left corner of the screen, X to the right and y to the up. So if a game implemented in Laya moves to Cocos, the coordinates will be a headache.

Second, the anchor point

After the anchor position is determined, all child nodes will take the anchor position as the origin of the coordinate system. Note that this behavior is different from the default behavior in the CoCOS2D-X engine and is a feature of the Cocos Creator coordinate system.

And the IDE’s default anchor point is 0.5, 0.5, so the anchor position is in the middle of the Sprite, and its children will use this point as the origin of coordinates. If you want to put one of its children in the lower left position, you need to set x and y to negative values.

Third, rendering differences

Everything in Laya is based on Sprite, which is also a container that can hold other components. Cocos, on the other hand, is based on nodes. The child of a Node Node must be Node, not Sprite. And Sprite is responsible for rendering logic, Node is just a container, and Node can only contain one Sprite component.

As you can see above, the way Cocos renders a component is pretty darn bad, writing a bunch of code just to render an image. Laya is simple. The diagram below.

By comparison, Laya is much simpler and more elegant. The Graphics class is also different. L AYA interface is simple and elegant. Cocos requires a lot of code to draw a rectangle as follows:

Laya is relatively simple, as follows:

Four, IDE differences

IDE is good, certainly Cocos wins a lot, the experience is better, simple drag can draw a scene, compared to Laya is much better, the degree of access is also much easier.

Other differences

In Laya, the protagonist is Stage. Only one. The main character in Cocos is Scene. You can have more than one. In fact, both are similar, as the main base container, carrying elements. The way the scene transitions is different. The last element to be added in Laya is added to the top layer. So just control the hierarchy of the scene. Cocos requires interface transition scenes as follows: cc.director. LoadScene (” scene name “);

If you want to know what game development needs to learn and the employment situation, please leave us a message.