得分结算页面

This commit is contained in:
panfudan
2025-06-06 22:54:09 +08:00
parent 94128b05ca
commit 63f4d1067e
7 changed files with 6009 additions and 5206 deletions

View File

@@ -8,6 +8,7 @@ import { Missions } from "../common/config/Mission";
import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
import { Timer } from "db://oops-framework/core/common/timer/Timer";
import { smc } from "../common/SingletonModuleComp";
import { GameEvent } from "../common/config/GameEvent";
const { ccclass, property } = _decorator;
@@ -21,7 +22,9 @@ export class MissionMonCompComp extends CCComp {
private isSpawning: boolean = false;// 是否正在生成怪物
private spawnInterval: number = 1; // 每个怪物生成间隔时间
private spawnTimer: number = 0; // 生成计时器
onLoad(){
this.on(GameEvent.FightStart,this.mon_refresh,this)
}
/** 视图层逻辑代码分离演示 */
start() {
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
@@ -30,9 +33,9 @@ export class MissionMonCompComp extends CCComp {
}
protected update(dt: number): void {
if(!smc.mission.play||smc.mission.pause) return
if(this.timer.update(dt)){
this.mon_refresh()
}
// if(this.timer.update(dt)){
// this.mon_refresh()
// }
// 处理刷怪队列
if (this.monsterQueue.length > 0 && !this.isSpawning) {
@@ -49,6 +52,7 @@ export class MissionMonCompComp extends CCComp {
mon_refresh(){
console.log("mon_refresh:start load monster lv :",smc.mission.lv)
let positions = [0, 1, 2];
positions.forEach(pos => {
let x = RandomManager.instance.getRandomInt(0, Missions[0].length, 1);