Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onLoad() {
this.curState = Gdt.commonInfo.gameState.start;
Gdt.common.batchInitObjPool(this, this.buffG);
},
createHeroBuff(emInfo) {
getNewBuff(BuffInfo, emInfo) {
const poolName = BuffInfo.name + 'Pool',
newNode = Gdt.common.genNewNode(this[poolName], BuffInfo.prefab, this.node),
emPos = emInfo.getPosition(),
newPos = cc.v2(emPos.x, emPos.y);
newNode.setPosition(newPos);
newNode.getComponent('buff').poolName = poolName;
},
//重新开始
onLoad() {
this.curState = Gdt.commonInfo.gameState.none;
this.isDeadBullet = false;
//初始化无限子弹组
Gdt.common.initObjPool(this, this.bulletInfinite);
//初始化有限子弹组
Gdt.common.batchInitObjPool(this, this.bulletFiniteG);
},
onLoad() {
this.curState = Gdt.commonInfo.gameState.none;
this.isDeadBullet = false;
//初始化无限子弹组
Gdt.common.initObjPool(this, this.bulletInfinite);
//初始化有限子弹组
Gdt.common.batchInitObjPool(this, this.bulletFiniteG);
},
onLoad() {
//初始化敌机组
this.curState = Gdt.commonInfo.gameState.none;
Gdt.common.batchInitObjPool(this, this.enemyG);
},
startAction() {
onLoad() {
Gdt.commonInfo = common;
Gdt.common = this;
this.batchInitObjPool = utils.batchInitObjPool;
this.initObjPool = utils.initObjPool;
this.genNewNode = utils.genNewNode;
this.backObjPool = utils.backObjPool;
}
});
enemyDied(nodeinfo, score) {
const poolName = nodeinfo.getComponent('enemy').poolName;
Gdt.common.backObjPool(this, poolName, nodeinfo);
//增加分数
if (parseInt(score) > 0) this.main.gainScore(score);
},
getScore() {
bulletDied(nodeinfo) {
const poolName = nodeinfo.getComponent('enemy_bullet').poolName;
Gdt.common.backObjPool(this, poolName, nodeinfo);
}
})
onLoad() {
this.curState = Gdt.commonInfo.gameState.start;
//初始enemy bullet
Gdt.common.initObjPool(this, this.enemybulletIfe);
},
enemyOpenFire(gteBEnemyInfo) {