dd
This commit is contained in:
@@ -50,6 +50,7 @@ export class MonsterViewComp extends CCComp {
|
||||
this.move(dt);
|
||||
}
|
||||
if(this.node.position.x < -300){
|
||||
console.log(this.node,this.ent)
|
||||
smc.monsters_in = smc.monsters_in.filter(element => element.eid !== this.ent.eid);
|
||||
this.node.destroy();
|
||||
}
|
||||
@@ -60,8 +61,10 @@ export class MonsterViewComp extends CCComp {
|
||||
this.node.setPosition(this.node.position.x-dt*this.speed, this.node.position.y, this.node.position.z);
|
||||
}
|
||||
update_pos(){
|
||||
smc.monsters_in.forEach(element => {
|
||||
smc.monsters_in.forEach((element,index) => {
|
||||
|
||||
if(element.eid == this.ent.eid){
|
||||
console.log("index:"+index)
|
||||
element.pos_x = this.node.position.x;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user