2019年4月

Box2D 碰撞組(collisiongroup)容許你指定一個整數的組索引值,你能夠設置具備相同組索引值的裝置發生碰撞(正索引),也能夠設置全部具備相同組索引值的裝置不會彼此碰撞(負索引)android

Layabox RigidBody group 設置 ide

  A  B  工具

  0  0  碰撞gradle

  0  1  碰撞ui

  1  1  碰撞this

   -1    -2  碰撞google

   -1       0        碰撞spa

      -1      -1       不碰撞code

private counter: number = 0;


public StartCounter() {
    for (let i = 0; i < 2; i++) {
        Laya.timer.once(3000, this, ()=>{ console.log(++this.counter); });
    }
}

Console
    1
    2
沒有覆蓋前面的

public CounterFunction() {
    console.log(++this.counter);
}

public StartCounter() {
    for (let i = 0; i < 2; i++) {
        Laya.timer.once(3000, this, this.CounterFunction);
    }
}

Console
    1

覆蓋了前面的
Laya.timer.once

 

Layaboxblog

Native版本 release-v2.0.2  

使用IDE構建工具

 

Android Studio

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependecies {
        classpath: 'com.android.tools.build:gradle:3.1.2"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}
View Code

sdkmanager --licenses

 

 

百度小遊戲

https://smartprogram.baidu.com/docs/game/tutorials/howto/dev/

相關文章
相關標籤/搜索