dd
This commit is contained in:
@@ -28,9 +28,10 @@ export class MapViewComp extends CCComp {
|
||||
onLoad(){
|
||||
// 监听全局事件
|
||||
oops.message.on("monster_load", this.onMonsterLoaded, this);
|
||||
this.addHero();
|
||||
}
|
||||
private onMonsterLoaded(event: string, args: any) {
|
||||
console.log('on_monster_load');
|
||||
// console.log('on_monster_load');
|
||||
}
|
||||
reset(): void {
|
||||
|
||||
@@ -43,16 +44,20 @@ export class MapViewComp extends CCComp {
|
||||
|
||||
/** 转场 */
|
||||
protected update(dt: number): void {
|
||||
if (this.timer.update(dt)) {
|
||||
// console.log('每2秒触发一次');
|
||||
this.addHero();
|
||||
}
|
||||
|
||||
this.shuaxin(dt)
|
||||
}
|
||||
|
||||
private mapLoaded() {
|
||||
|
||||
}
|
||||
|
||||
shuaxin(dt: number) {
|
||||
smc.vm_data.shuaxin.min += smc.vm_data.shuaxin.speed*dt;
|
||||
if (smc.vm_data.shuaxin.min >= smc.vm_data.shuaxin.max) {
|
||||
smc.vm_data.shuaxin.min = 0;
|
||||
this.addHero();
|
||||
}
|
||||
}
|
||||
/** 添加玩家 */
|
||||
private addHero() {
|
||||
this.scene.node.active = true
|
||||
|
||||
Reference in New Issue
Block a user