dd
This commit is contained in:
@@ -49,13 +49,13 @@ export class BoxRangComp extends CCComp {
|
||||
}
|
||||
onPreSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
|
||||
if(selfCollider.group != otherCollider.group&&otherCollider.tag == 0){
|
||||
this.MonsterViewComp.is_atking = true;
|
||||
let scene =smc.map.MapView.scene.mapLayer!.node!
|
||||
let other_pos = otherCollider.node.getWorldPosition() ;
|
||||
let self_pos = this.node.getWorldPosition();
|
||||
// console.log("onPreSolve:",self_pos,other_pos);
|
||||
if(Math.abs(other_pos.x-self_pos.x) < BoxSet.ATK_RANGE_X){
|
||||
this.MonsterViewComp.stop_cd = 0.1
|
||||
this.MonsterViewComp.is_atking = true;
|
||||
// this.MonsterViewComp.stop_cd = 0.1
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ export class CSkillComp extends CCComp {
|
||||
}else{
|
||||
m_pos = v3(BoxSet.MONSTER_START,BoxSet.GAME_LINE)
|
||||
}
|
||||
t_pos = v3(m_pos.x-this.node.position.x,m_pos.y-this.node.position.y)
|
||||
t_pos = v3(m_pos.x-this.node.position.x,m_pos.y-this.node.position.y) // 目标增量
|
||||
// console.log("m_pos",this.node.position,m_pos);
|
||||
let dx=m_pos.x-this.node.position.x
|
||||
let dy=m_pos.y-this.node.position.y
|
||||
|
||||
@@ -63,9 +63,7 @@ export class HeroCard extends ecs.Entity {
|
||||
node.parent = parent;
|
||||
// node.getChildByName("avatar").setScale(node.getChildByName("avatar").scale.x*scale, node.getChildByName("avatar").scale.y, node.getChildByName("avatar").scale.z);
|
||||
node.setPosition(pos)
|
||||
|
||||
resources.load(url, SpriteAtlas, (err: any, atlas) => {
|
||||
console.log("hero_card load",node)
|
||||
const sprite = node.getChildByName("hero").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(pathName);
|
||||
});
|
||||
|
||||
@@ -208,7 +208,7 @@ export class MonsterViewComp extends CCComp {
|
||||
// console.log("monster shoot");
|
||||
let skill = ecs.getEntity<Skill>(Skill);
|
||||
let x=32
|
||||
let pos = v3(32,30)
|
||||
let pos = v3(35,40)
|
||||
let scale = this.scale
|
||||
let speed =SkillSet[skill_uuid].speed;
|
||||
let dis = SkillSet[skill_uuid].dis;
|
||||
|
||||
Reference in New Issue
Block a user