游戏位置改变

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

File diff suppressed because it is too large Load Diff

View File

@@ -911,7 +911,7 @@
"__id__": 41
}
],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 47

View File

@@ -35,7 +35,7 @@ export class RoleViewComp extends CCComp {
hp_max:number = 1000;
power: number = 0;
stop_cd:number = 0;
atk_cd:number = 3;
atk_cd:number = 5;
atk:number = 10;
skill_uuid:number = 9003;
max_skill_uuid:number = 1001;

View File

@@ -81,11 +81,11 @@ export class MapMonsterComp extends CCComp {
switch (x) {
case 1:
monster_layer = scene.entityLayer1!.node!;
pos.y=pos.y+5;
pos.y=pos.y+200;
break;
case 2:
monster_layer= scene.entityLayer2!.node!;
pos.y=pos.y-5;
pos.y=pos.y+100;
default:
break;
}

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;
@@ -137,10 +141,11 @@ export class HeroCardViewComp extends CCComp {
break;
case 2:
oops.message.dispatchEvent("do_use_skill", { uuid: this.card_uid });
// console.log("do_use_skill",this.card_uid)
break;
case 3:
oops.message.dispatchEvent("do_use_skill", { uuid: 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;