得分结算页面

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

View File

@@ -6053,7 +6053,7 @@
"a": 255
},
"_spriteFrame": {
"__uuid__": "f87f53f9-2fba-4a5b-968a-79a593311ab2@0ec4f",
"__uuid__": "f87f53f9-2fba-4a5b-968a-79a593311ab2@518f0",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 1,
@@ -6147,7 +6147,7 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 7.086,
"x": 0,
"y": 0,
"z": 0
},
@@ -6224,7 +6224,7 @@
"b": 255,
"a": 255
},
"_string": "召唤",
"_string": "选择",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 25,
@@ -6299,7 +6299,7 @@
"__id__": 276
}
],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 284

File diff suppressed because it is too large Load Diff

View File

@@ -18,6 +18,7 @@ export class SingletonModuleComp extends ecs.Comp {
status:0, //0:未开始 1:进行中 2:胜利 3:失败
play:false,
pause:false,
score:888,
};
fight_heros=[]
mheros:any = [];

View File

@@ -67,11 +67,12 @@ export enum FightSet {
}
export const MissionData = {
gold:10,//金币
refresh_gold:1,//刷新金币
score:0,//分数
refresh_gold:3,//刷新金币
refrsh_time:1, //刷新时间
call_gold:3,//召唤金币
call_gold:0,//召唤金币
add_gold:1,//金币增加
change_gold:1,//金币变化
change_gold:0,//金币变化
exp:0,//经验
skp:0,//技能点
box:0,//宝箱

View File

@@ -256,7 +256,7 @@ export class HeroViewComp extends CCComp {
console.log("角色死亡",this.hero_uuid)
if(this.is_master){
console.log("英雄死亡")
oops.message.dispatchEvent(GameEvent.FightEnd,this)
oops.message.dispatchEvent(GameEvent.FightEnd,{victory:false})
}
}
do_atked(remainingDamage:number){

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);

View File

@@ -26,7 +26,7 @@ export class VictoryComp extends CCComp {
/** 视图层逻辑代码分离演示 */
protected onLoad(): void {
this.on(GameEvent.MissionStart,this.mission_start,this)
this.on(GameEvent.FightEnd,this.mission_complete,this)
this.on(GameEvent.FightEnd,this.fight_end,this)
}
onAdded(args: any) {
@@ -34,7 +34,9 @@ export class VictoryComp extends CCComp {
mission_start(){
this.hide()
}
mission_complete(){
fight_end(e:any,val:any){
this.node.getChildByName("score").getComponent(Label).string=smc.mission.score.toString()
this.node.getChildByName("score_add").getComponent(Label).string=smc.vmdata.mission_data.score.toString()
this.open()
}
victory_end(){