得分结算页面
This commit is contained in:
@@ -6053,7 +6053,7 @@
|
|||||||
"a": 255
|
"a": 255
|
||||||
},
|
},
|
||||||
"_spriteFrame": {
|
"_spriteFrame": {
|
||||||
"__uuid__": "f87f53f9-2fba-4a5b-968a-79a593311ab2@0ec4f",
|
"__uuid__": "f87f53f9-2fba-4a5b-968a-79a593311ab2@518f0",
|
||||||
"__expectedType__": "cc.SpriteFrame"
|
"__expectedType__": "cc.SpriteFrame"
|
||||||
},
|
},
|
||||||
"_type": 1,
|
"_type": 1,
|
||||||
@@ -6147,7 +6147,7 @@
|
|||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 7.086,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
@@ -6224,7 +6224,7 @@
|
|||||||
"b": 255,
|
"b": 255,
|
||||||
"a": 255
|
"a": 255
|
||||||
},
|
},
|
||||||
"_string": "召唤",
|
"_string": "选择",
|
||||||
"_horizontalAlign": 1,
|
"_horizontalAlign": 1,
|
||||||
"_verticalAlign": 1,
|
"_verticalAlign": 1,
|
||||||
"_actualFontSize": 25,
|
"_actualFontSize": 25,
|
||||||
@@ -6299,7 +6299,7 @@
|
|||||||
"__id__": 276
|
"__id__": 276
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_active": true,
|
"_active": false,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 284
|
"__id__": 284
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -18,6 +18,7 @@ export class SingletonModuleComp extends ecs.Comp {
|
|||||||
status:0, //0:未开始 1:进行中 2:胜利 3:失败
|
status:0, //0:未开始 1:进行中 2:胜利 3:失败
|
||||||
play:false,
|
play:false,
|
||||||
pause:false,
|
pause:false,
|
||||||
|
score:888,
|
||||||
};
|
};
|
||||||
fight_heros=[]
|
fight_heros=[]
|
||||||
mheros:any = [];
|
mheros:any = [];
|
||||||
|
|||||||
@@ -67,11 +67,12 @@ export enum FightSet {
|
|||||||
}
|
}
|
||||||
export const MissionData = {
|
export const MissionData = {
|
||||||
gold:10,//金币
|
gold:10,//金币
|
||||||
refresh_gold:1,//刷新金币
|
score:0,//分数
|
||||||
|
refresh_gold:3,//刷新金币
|
||||||
refrsh_time:1, //刷新时间
|
refrsh_time:1, //刷新时间
|
||||||
call_gold:3,//召唤金币
|
call_gold:0,//召唤金币
|
||||||
add_gold:1,//金币增加
|
add_gold:1,//金币增加
|
||||||
change_gold:1,//金币变化
|
change_gold:0,//金币变化
|
||||||
exp:0,//经验
|
exp:0,//经验
|
||||||
skp:0,//技能点
|
skp:0,//技能点
|
||||||
box:0,//宝箱
|
box:0,//宝箱
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ export class HeroViewComp extends CCComp {
|
|||||||
console.log("角色死亡",this.hero_uuid)
|
console.log("角色死亡",this.hero_uuid)
|
||||||
if(this.is_master){
|
if(this.is_master){
|
||||||
console.log("英雄死亡")
|
console.log("英雄死亡")
|
||||||
oops.message.dispatchEvent(GameEvent.FightEnd,this)
|
oops.message.dispatchEvent(GameEvent.FightEnd,{victory:false})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
do_atked(remainingDamage:number){
|
do_atked(remainingDamage:number){
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { Missions } from "../common/config/Mission";
|
|||||||
import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
|
import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
|
||||||
import { Timer } from "db://oops-framework/core/common/timer/Timer";
|
import { Timer } from "db://oops-framework/core/common/timer/Timer";
|
||||||
import { smc } from "../common/SingletonModuleComp";
|
import { smc } from "../common/SingletonModuleComp";
|
||||||
|
import { GameEvent } from "../common/config/GameEvent";
|
||||||
|
|
||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
|
|
||||||
@@ -21,7 +22,9 @@ export class MissionMonCompComp extends CCComp {
|
|||||||
private isSpawning: boolean = false;// 是否正在生成怪物
|
private isSpawning: boolean = false;// 是否正在生成怪物
|
||||||
private spawnInterval: number = 1; // 每个怪物生成间隔时间
|
private spawnInterval: number = 1; // 每个怪物生成间隔时间
|
||||||
private spawnTimer: number = 0; // 生成计时器
|
private spawnTimer: number = 0; // 生成计时器
|
||||||
|
onLoad(){
|
||||||
|
this.on(GameEvent.FightStart,this.mon_refresh,this)
|
||||||
|
}
|
||||||
/** 视图层逻辑代码分离演示 */
|
/** 视图层逻辑代码分离演示 */
|
||||||
start() {
|
start() {
|
||||||
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||||
@@ -30,9 +33,9 @@ export class MissionMonCompComp extends CCComp {
|
|||||||
}
|
}
|
||||||
protected update(dt: number): void {
|
protected update(dt: number): void {
|
||||||
if(!smc.mission.play||smc.mission.pause) return
|
if(!smc.mission.play||smc.mission.pause) return
|
||||||
if(this.timer.update(dt)){
|
// if(this.timer.update(dt)){
|
||||||
this.mon_refresh()
|
// this.mon_refresh()
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 处理刷怪队列
|
// 处理刷怪队列
|
||||||
if (this.monsterQueue.length > 0 && !this.isSpawning) {
|
if (this.monsterQueue.length > 0 && !this.isSpawning) {
|
||||||
@@ -49,6 +52,7 @@ export class MissionMonCompComp extends CCComp {
|
|||||||
|
|
||||||
|
|
||||||
mon_refresh(){
|
mon_refresh(){
|
||||||
|
console.log("mon_refresh:start load monster lv :",smc.mission.lv)
|
||||||
let positions = [0, 1, 2];
|
let positions = [0, 1, 2];
|
||||||
positions.forEach(pos => {
|
positions.forEach(pos => {
|
||||||
let x = RandomManager.instance.getRandomInt(0, Missions[0].length, 1);
|
let x = RandomManager.instance.getRandomInt(0, Missions[0].length, 1);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export class VictoryComp extends CCComp {
|
|||||||
/** 视图层逻辑代码分离演示 */
|
/** 视图层逻辑代码分离演示 */
|
||||||
protected onLoad(): void {
|
protected onLoad(): void {
|
||||||
this.on(GameEvent.MissionStart,this.mission_start,this)
|
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) {
|
onAdded(args: any) {
|
||||||
|
|
||||||
@@ -34,7 +34,9 @@ export class VictoryComp extends CCComp {
|
|||||||
mission_start(){
|
mission_start(){
|
||||||
this.hide()
|
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()
|
this.open()
|
||||||
}
|
}
|
||||||
victory_end(){
|
victory_end(){
|
||||||
|
|||||||
Reference in New Issue
Block a user