APP, small program open source small game engine, support 2D, 3D game development

APP, small program open source small game engine, support 2D, 3D game development

2022-10-10 0 1,256
Resource Number 44987 Last Updated 2025-02-24
¥ 0USD Upgrade VIP
Download Now Matters needing attention
Can't download? Please contact customer service to submit a link error!
Value-added Service: Installation Guide Environment Configuration Secondary Development Template Modification Source Code Installation

This issue recommends a small game engine that supports 2D and 3D game and application development – LayaAir.

 APP, small program open source small game engine, support 2D, 3D game development插图

Support WebGL 1.0 and 2.0 adaptive. Support ActionScript3, TypeScript, JavaScript three development languages, suitable for 2D, 3D product development. Performance comparable to native APP, once developed HTML5, APP(Android and iOS), small games (wechat small games, QQ small games, Baidu small games, Alipay small games, BiliBili small games, Bytedance small games, millet fast games, OPPO small games, vivo small games, Huawei fast games, etc.) released at the same time on various platforms.

Features

The LayaAir engine mainly includes two core parts: engine library and LayaAir IDE.

LayaAir2.0 engine library function

    • The LayaAir2.0 engine not only maintains the original functionality of 1.0, such as: Sprites, vector graphics, text, rich text, bitmap fonts, animation, bones, audio and video, filters, events, loading, easing, time, network, UI system, physical system, TiledMap, prtocol and other apis;
    • Also adds a built-in box2D physics engine, componentization support, and more than 150 3D features, such as: The main new official materials include PBRStandardMaterial, PBRSpecularMaterial and UnlitMaterial.
    • Texture, add a variety of texture parameter configurations (mipmap, format, wrapModeU, wrapModeV, filterMode, anisoLevel), add texture upload pixel interface, GPU texture compression.
    • In terms of animation, new crossFade function of Animator animation fusion is added, multi-layer mixing of animation is added, animation update mechanism is adjusted to real-time interpolation, which greatly reduces memory and animation fluency performance, and multi-material attribute animation

is added.

  • Support the development of 2D and 3D product development, support the simultaneous release of Web (browser, webView), Native APP (IOS, Android), small games (wechat, hand Q, Baidu, Toutiao, Tiktok, Xiaomi, OPPO, vivo, Huawei), and other versions.

APP, small program open source small game engine, support 2D, 3D game development插图1

APP, small program open source small game engine, support 2D, 3D game development插图2

LayaAir2.0 IDE features

LayaAir2.0 IDE mainly includes project management, code development editor, visual editor, third-party toolchain support tools and so on. The main features include:

  • Code development
  • UI and scene editor
  • Scene management (new in 2.0)
  • Particle editor
  • Animation editor
  • Physical editor (new in 2.0)
  • Component support (new in 2.0)
  • 3D support (new in 2.0)
  • Supported by LayaCloud project (2.0 new)
  • Script extension
  • Default
  • APP package
  • JS obfuscation and compression
  • third-party toolchain conversion tools (Unity3D, TiledMap, Spine, Keel…)

Laya2.0 IDE is compatible with LayaAir 1.x version, in 2d projects, you can upgrade the original project to 2.0 engine without too much change (backup is recommended before upgrading)

Laya2.0 IDE adopts the way of mounting component scripts and scene management to develop, edit scene and page components in the ide, and add scripts to make the project development more conducive to the collaborative work of program, art and planning. Easier to get started and more friendly to develop.

APP, small program open source small game engine, support 2D, 3D game development插图3

APP, small program open source small game engine, support 2D, 3D game development插图4

Development language

Since the LayaAir engine supports ActionScript3 (AS3), TypeScript (TS), JavaScript (JS) three languages, which language is better to use? It’s often confusing for people who are new to engines. Here is a brief introduction.

About JS language

It should be noted that although JS language is easier to get started, but as a weakly typed language, the difficulty of development and debugging, as well as the management of large projects and multi-person collaboration, are not as good as TS and AS3, which can detect the type and syntax in the IDE language. When the code is more and more, JS once accidentally written wrong, IDE will not have any hint, only in the running time will find the problem, often developers in order to check a small mistake, spend a lot of time cost. So while JS language development is supported, it is not recommended to adopt the language for medium or large projects.

About TS language

TS language is the official recommended development language for LayaAir engine, and it is also the language used by LayaAir engine source code since engine 2.2. In the official 2.0 engine video teaching, only TS language will be used for teaching.

About AS language

AS language is LayaAir 2.2 version of the engine source language before the AS3 language was once the dominant page game era, but since Adobe officially announced the abandonment of Flash, also represents the language will also enter the unmaintained situation. Those new language features are naturally difficult to support, and there is no doubt that continuing to use the language will be a drag on the engine. AS a result, the source language of the LayaAir engine has been changed, but the 2.X version of the engine and the AS language version will remain compatible and maintained. However, support for the language will definitely be dropped in future 3.x releases. Developers are advised not to use AS when creating new projects.

Code example

APP, small program open source small game engine, support 2D, 3D game development插图5

Scene loading

ActionScript

package LayaAir3D_Scene3D {
	import common.CameraMoveScript;
	import laya.d3.core.Camera;
	import laya.d3.core.scene.Scene3D;
	import laya.d3.math.Vector3;
	import laya.d3.math.Vector4;
	import laya.display.Stage;
	import laya.utils.Handler;
	import laya.utils.Stat;
	
	public class SceneLoad1 {
		public function SceneLoad1() {
			//Initializing the engine
			Laya3D.init(0, 0);
			Stat.show();
			Laya.stage.scaleMode = Stage.SCALE_FULL;
			Laya.stage.screenMode = Stage.SCREEN_NONE;
			//Loading the scene
			Scene3D.load("res/threeDimen/scene/LayaScene_dudeScene/Conventional/dudeScene.ls", Handler.create(this, function(scene:Scene3D):void {
				Laya.stage.addChild(scene) as Scene3D;
				
				//Get the camera in the scene
				var camera:Camera = scene.getChildByName("Camera") as Camera;
				//Moving the camera position
				camera.transform.position = new Vector3(0, 0.81, -1.85);
				//Rotate the camera Angle
				camera.transform.rotate(new Vector3(0, 0, 0), true, false);
				//Set the camera field of view (Angle)
				camera.fieldOfView = 60;
				//Set the background color
				camera.clearColor = new Vector4(0, 0, 0.6, 1);
				//Add the camera movement control script
				camera.addComponent(CameraMoveScript);
				
				//Set the ambient color of the light
				//scene.ambientColor = new Vector3(2.5, 0, 0);
			}));
		}
	}
}

JavaScript

class SceneLoad1{
	constructor(){
		Laya3D.init(0, 0);
        Laya.Stat.show();
        Laya.stage.scaleMode = Laya.Stage.SCALE_FULL;
        Laya.stage.screenMode = Laya.Stage.SCREEN_NONE;
        Laya.Scene3D.load("res/threeDimen/scene/LayaScene_dudeScene/Conventional/dudeScene.ls", Laya.Handler.create(this, this.sceneLoadFinished));
	}
	sceneLoadFinished(scene){
		Laya.stage.addChild(scene);
        let camera = scene.getChildByName("Camera");
        camera.addComponent(CameraMoveScript);
	}
}

//Activate the launch class
new SceneLoad1();

TypeScript

import CameraMoveScript from "./common/CameraMoveScript"
class SceneLoad1 {
    constructor() {
        Laya3D.init(0, 0);
        Laya.Stat.show();
        Laya.stage.scaleMode = Laya.Stage.SCALE_FULL;
        Laya.stage.screenMode = Laya.Stage.SCREEN_NONE;
        
        Laya.Scene3D.load("res/threeDimen/scene/LayaScene_dudeScene/Conventional/dudeScene.ls", Laya.Handler.create(null, function(scene:Laya.Scene3D):void {
            Laya.stage.addChild(scene) as Laya.Scene3D;
            var camera:Laya.Camera = scene.getChildByName("Camera") as Laya.Camera;
            camera.addComponent(CameraMoveScript);
        }));
    }
}
new SceneLoad1;

Engine Example

8f964fef166b463592ffac920ae594bfnoop.image_

Environmental reflection

APP, small program open source small game engine, support 2D, 3D game development插图7

Light mapping

APP, small program open source small game engine, support 2D, 3D game development插图8

Directional light

e5ba3afc1aff4124933753b42b9e99b5noop.image_

Mesh loading

APP, small program open source small game engine, support 2D, 3D game development插图10

Base collider

a82592389a894f989d3d03e84eadd65anoop.image_

Refraction of glass

APP, small program open source small game engine, support 2D, 3D game development插图12

Model Example

—END—

Open source License:
https://gitee.com/layabox/LayaAir/blob/master/LICENSE.md

资源下载此资源为免费资源立即下载
Telegram:@John_Software

Disclaimer: This article is published by a third party and represents the views of the author only and has nothing to do with this website. This site does not make any guarantee or commitment to the authenticity, completeness and timeliness of this article and all or part of its content, please readers for reference only, and please verify the relevant content. The publication or republication of articles by this website for the purpose of conveying more information does not mean that it endorses its views or confirms its description, nor does it mean that this website is responsible for its authenticity.

Ictcoder Free source code APP, small program open source small game engine, support 2D, 3D game development https://ictcoder.com/kyym/app%e3%80%81-open-source-mini-game-engine-for-mini-programs-supporting-2d-and-3d-game-development.html

Share free open-source source code

Q&A
  • 1, automatic: after taking the photo, click the (download) link to download; 2. Manual: After taking the photo, contact the seller to issue it or contact the official to find the developer to ship.
View details
  • 1, the default transaction cycle of the source code: manual delivery of goods for 1-3 days, and the user payment amount will enter the platform guarantee until the completion of the transaction or 3-7 days can be issued, in case of disputes indefinitely extend the collection amount until the dispute is resolved or refunded!
View details
  • 1. Heptalon will permanently archive the process of trading between the two parties and the snapshots of the traded goods to ensure that the transaction is true, effective and safe! 2, Seven PAWS can not guarantee such as "permanent package update", "permanent technical support" and other similar transactions after the merchant commitment, please identify the buyer; 3, in the source code at the same time there is a website demonstration and picture demonstration, and the site is inconsistent with the diagram, the default according to the diagram as the dispute evaluation basis (except for special statements or agreement); 4, in the absence of "no legitimate basis for refund", the commodity written "once sold, no support for refund" and other similar statements, shall be deemed invalid; 5, before the shooting, the transaction content agreed by the two parties on QQ can also be the basis for dispute judgment (agreement and description of the conflict, the agreement shall prevail); 6, because the chat record can be used as the basis for dispute judgment, so when the two sides contact, only communicate with the other party on the QQ and mobile phone number left on the systemhere, in case the other party does not recognize self-commitment. 7, although the probability of disputes is very small, but be sure to retain such important information as chat records, mobile phone messages, etc., in case of disputes, it is convenient for seven PAWS to intervene in rapid processing.
View details
  • 1. As a third-party intermediary platform, Qichou protects the security of the transaction and the rights and interests of both buyers and sellers according to the transaction contract (commodity description, content agreed before the transaction); 2, non-platform online trading projects, any consequences have nothing to do with mutual site; No matter the seller for any reason to require offline transactions, please contact the management report.
View details

Related Article

make a comment
No comments available at the moment
Official customer service team

To solve your worries - 24 hours online professional service