Jump to content

A game about fighter jets against aliens


renjianfeng
 Share

Recommended Posts

Holle!~~

Translation of some keywords

【进入游戏】->【PLAY】

【瞄准方式】->【Target mode

【重新开始】->【restart

【重力感应】->【gravity sensor

Sorry, My English is not so good :D

Babylon is an excellent js game engine

Play with it!  

thinks!!!!

url:https://forreall.cn/3ds/app/zhanji/

jietu1.jpg

jietu2.jpg

Link to comment
Share on other sites

16 hours ago, NasimiAsl said:

nice i see it :) nice explode effect

see this explode http://www.babylonjs-playground.com/#1CQ02P#2  when you touch (with move) with any ball 

http://www.babylonjs-playground.com/#1JUXK5#28

I've isolated the code for the explosion

If you can access this link:http://www.babylonjs-playground.com/#DF7L62  

Or copy the following code

var createScene = function () {

   var scene = new BABYLON.Scene(engine);

        // 改变场景的背景色为绿色.
        scene.clearColor = new BABYLON.Color3(0,0,0);

        // 创建并放置一个自由相机
        camera = new BABYLON.ArcRotateCamera("ArcRotateCamera", 1, 0.8, 10, new BABYLON.Vector3(0, 10, 10), scene);

        // 将相机朝向对准场景原点
        camera.setTarget(BABYLON.Vector3.Zero());
        camera.alpha=-1.5323623309935623
        camera.beta=1.5432693652698335
        camera.radius=30230.65589950958778
        camera.maxZ=60000

        // 将相机附加到画布上
        camera.attachControl(canvas, false);

        // 创建一个光源,在0,1,0点朝向天空.
        var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(115, 115, 115), scene);

        // 将光源光线置为昏暗
        light.intensity = 2;
        //var sphere = BABYLON.Mesh.CreateSphere("sphere1", 1, 10, scene);
        // 让我们尝试Babylonjs内置的'球'状造型. 参数:名称, 细分度, 大小, 场景



        urlCdn="https://meshcdn.dim3d.xyz/zhanji/"

        var setBoom=new setBooms(new BABYLON.Vector3(-16,0,0))


        setInterval(function(){
            setBoom.Position(new BABYLON.Vector3(0,0,0))
            setBoom.start();
            setTimeout(function(){
                setBoom.stop();
            },100)
        },1000)
       
        

        function setBooms(position){
            var fountain = BABYLON.Mesh.CreateBox("fountain", 1.0, scene);
            fountain.visibility=0;
            fountain.rotation.x=Math.PI*0.9;
            var particleSystem = new BABYLON.ParticleSystem("particles", 2000, scene);

            //粒子的纹理
            particleSystem.particleTexture = new BABYLON.Texture(urlCdn+"images/boom.png", scene);

            //颜色过滤
            particleSystem.textureMask = new BABYLON.Color4(1, 1, 1 ,1.0);


            //定义发射器
            particleSystem.emitter = fountain; // the starting object, the emitter, a box in this case.

            particleSystem.minEmitBox = new BABYLON.Vector3(0, 0, 0); // Starting all From

            particleSystem.color1 = new BABYLON.Color4(1, 1, 1 ,1.0);
            particleSystem.color2 = new BABYLON.Color4(1, 1, 1 ,1.0);
            particleSystem.colorDead = new BABYLON.Color4(0, 0, 0 ,0);

            particleSystem.minSize = 2000;
            particleSystem.maxSize = 2000;

            // console.log(particleSystem)

            particleSystem.minLifeTime = 6;
            particleSystem.maxLifeTime = 6;

            particleSystem.emitRate = 40;

            // particleSystem.manualEmitCount = 300;

            particleSystem.blendMode = BABYLON.ParticleSystem.BLENDMODE_ONEONE;


            particleSystem.direction1 = new BABYLON.Vector3(10, -10, 10);
            // particleSystem2.direction2 = new BABYLON.Vector3(0, 100, 0);



            // Speed
            particleSystem.minEmitPower = 50;
            particleSystem.maxEmitPower = 50;
            particleSystem.updateSpeed = 0.1;


            particleSystem.stop();

            this.start=function(){
                particleSystem.start();
            }

            this.stop=function(){
                particleSystem.stop();
            }
            this.Position=function(position){
                fountain.position=position;
            }

            fountain.position=position;
            // fountain.rotation=rotation;
        }




        //  var yun2=yun.clone()


        // BABYLON.Animation.CreateAndStartAnimation('boxposition', yun, 'position.x', 30, 120, 0, 13);

        // 将移动球向上 1/2 其高度
        //  sphere.position.y = 1;
        // 离开该函数
        return scene;

};

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...