下一步:怪物路线设置

This commit is contained in:
2024-09-18 14:18:23 +08:00
parent 839ccba3de
commit 2ab7279b04
5 changed files with 20 additions and 34 deletions

View File

@@ -48,8 +48,8 @@ export class Hero extends ecs.Entity {
// var as = node.getComponent(HeroSpine);
// let ratio=this.set_ratio(uuid);
// node.setScale(node.scale.x*scale*ratio, node.scale.y*ratio, 0);
pos.x=smc.Role.RoleView.node.position.x+pos.x;
pos.y=smc.Role.RoleView.node.position.y+pos.y;
// pos.x=smc.Role.RoleView.node.position.x+pos.x;
// pos.y=smc.Role.RoleView.node.position.y+pos.y;
node.setPosition(pos)
this.hero_init(uuid,node,index)
oops.message.dispatchEvent("hero_load",this)

View File

@@ -185,12 +185,12 @@ export class HeroViewComp extends CCComp {
if(this.stop_cd > 0){
return
}
if (this.scale === 1 && this.node.position.x >= BoxSet.MONSTER_START-150) {
if (this.node.position.x >= 250-this.atk_dis) {
return;
}
if(this.enemy){
return
}
// if(this.enemy){
// return
// }
this.node.setPosition(this.node.position.x+dt*this.speed*this.scale, this.node.position.y+dt*this.dir_y, this.node.position.z);
}
hp_show(){
@@ -407,7 +407,7 @@ export class HeroViewComp extends CCComp {
if(this.hp <= 0){
this.dead();
this.is_dead = true;
smc.role_heros[this.role_heros_index].eid == 0
// smc.role_heros[this.role_heros_index].eid == 0
setTimeout(() => {
this.ent.destroy();
}, 15);