This commit is contained in:
2024-08-07 16:21:56 +08:00
parent 45e37e1368
commit c19a6b5316
8 changed files with 1577 additions and 71 deletions

View File

@@ -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