接下来 优化技能
This commit is contained in:
@@ -172,19 +172,14 @@ export class MonViewComp extends CCComp {
|
||||
if(this.stop_cd > 0){
|
||||
return
|
||||
}
|
||||
if (this.scale === 1 && this.node.position.x >= 120) {
|
||||
if(this.scale===-1&&this.node.position.x <= BoxSet.HERO_START){
|
||||
return;
|
||||
}
|
||||
|
||||
if(this.scale===-1&&this.node.position.x <= BoxSet.HERO_START+this.atk_cd){
|
||||
return;
|
||||
}
|
||||
|
||||
this.set_diry()
|
||||
this.node.setPosition(this.node.position.x+dt*this.speed*this.scale, this.node.position.y+dt*this.dir_y, this.node.position.z);
|
||||
}
|
||||
set_diry(){
|
||||
this.dir_y=-(this.node.position.y-BoxSet.GAME_LINE)/60
|
||||
this.dir_y=-(this.node.position.y-BoxSet.GAME_LINE)/20
|
||||
}
|
||||
move_to(){
|
||||
var move = this.ent.get(MoveToComp) || this.ent.add(MoveToComp);
|
||||
@@ -218,7 +213,6 @@ export class MonViewComp extends CCComp {
|
||||
}
|
||||
//使用max_skill
|
||||
do_max_skill(){
|
||||
|
||||
let skill = ecs.getEntity<Skill>(Skill);
|
||||
let scale = this.scale
|
||||
let speed =smc.skills[this.max_skill_uuid].speed;
|
||||
@@ -244,7 +238,7 @@ export class MonViewComp extends CCComp {
|
||||
}
|
||||
}
|
||||
get_enemy_pos(){
|
||||
let pos = v3(35*this.scale,50)
|
||||
let pos = v3(35*this.scale,25)
|
||||
let angle=0
|
||||
let t_pos:Vec3 = v3(0,0)
|
||||
if(this.enemy){
|
||||
@@ -252,7 +246,7 @@ export class MonViewComp extends CCComp {
|
||||
console.log("move_to",this.enemy.isValid);
|
||||
return
|
||||
}
|
||||
t_pos = v3(this.enemy.position.x-(this.node.position.x+pos.x),this.enemy.position.y-(this.node.position.y+pos.y)+BoxSet.ATK_Y)
|
||||
t_pos = v3(this.enemy.position.x-(this.node.position.x+pos.x)*1.1,(this.enemy.position.y-(this.node.position.y+pos.y)+BoxSet.ATK_Y)*1.1)
|
||||
angle = Math.atan2(t_pos.y,t_pos.x) * 180 / Math.PI;
|
||||
if(this.scale == -1){
|
||||
angle = angle +180
|
||||
|
||||
Reference in New Issue
Block a user