资源加载
this.addEventListener(egret.Event.ADDED_TO_STAGE,this.onAddToStage,this)
RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE,this.onConfigComplete,this)
RES.loadConfig("resource/default.res.json","resource/")
RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE,this.onConfigComplete,this)
RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE,this.onResourceLoadComplete,this)
RES.loadGroup("preload")
if(event.groupName=="preload"){
RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE,this.onResourceLoadComplete,this)
this.createGameScene()
}
数组
创建与初始化数组
var array = new Array<T>([length])
Math.random()
Math.floor()
Math.ceil()