游戏位置改变

This commit is contained in:
2024-09-02 10:50:59 +08:00
parent f367d1817a
commit 2062ff3b36
7 changed files with 901 additions and 201 deletions

View File

@@ -36,7 +36,6 @@ export class CSkillComp extends CCComp {
this.cd = new Timer(smc.skills[this.skill_uuid].cd)
this.time =smc.skills[this.skill_uuid].sd
this.node.getChildByName("time").getComponent(Label).string = this.time.toString()
}
protected update(dt: number): void {
if (this.sd.update(dt)) {

View File

@@ -10,12 +10,16 @@ import { HeroCard } from "./HeroCard";
import { HeroModelComp } from "./HeroModelComp";
import { Hero } from "./Hero";
import { MonsterViewComp } from "./MonsterViewComp";
import { MapMonsterComp } from "../map/MapMonsterComp";
import { MapSkillComp } from "../map/MapSkillComp";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@ccclass('HeroCardViewComp')
@ecs.register('HeroCardView', false)
export class HeroCardViewComp extends CCComp {
MM: MapMonsterComp;
MS: MapSkillComp;
card_name:string = "hero_card";
card_uid:number = 1000;
in_destroy:boolean = false;
@@ -136,11 +140,12 @@ export class HeroCardViewComp extends CCComp {
oops.message.dispatchEvent("do_add_hero", { uuid: this.card_uid });
break;
case 2:
oops.message.dispatchEvent("do_use_skill", { uuid: this.card_uid });
break;
case 3:
oops.message.dispatchEvent("do_use_skill", { uuid: this.card_uid });
// console.log("do_use_skill",this.card_uid)
break;
default:
break;
}

View File

@@ -52,7 +52,7 @@ export class MonsterViewComp extends CCComp {
hp_speed: number = 0; //每秒回复量
power: number = 0; /**能量**/
power_max: number = 60; /** 能量最大值 */
power_max: number = 1200; /** 能量最大值 */
power_speed: number = 1; //能量回复速度每0.1秒回复量
skill_name: string = "base"; //技能名称
@@ -257,7 +257,9 @@ export class MonsterViewComp extends CCComp {
}
add_hp(hp: number=0){
console.log("hero 加血动画");
this.tooltip(2,"+"+hp.toString());
this.tooltip(2,hp.toString());
let hp_progress= this.hp/this.hp_max;
this.node.getChildByName("top").getChildByName("hp").getComponent(ProgressBar)!.progress = hp_progress;
}
shield_change(hp: number){
let ls=this.shield - hp;