i make bullet and the unit fire the bullet.
and i use action(node.runAction()) cc.moveTo for bullet’s node.
start(){
this.action = cc.moveTo(distance / movePixel, targetX, targetY);
this.node.runAction(action);
}
and i check finish the action in update() method.
(i think, if it has listener, use listener is better than check every frames
but i can’t found action listener. so i use this way i don’t have any choice)
update(dt) {
if (this.action && this.action .isDone()) {
cc.log("bullet" + this.bulletId + " is arrived to target!");
this.damageToTarget();
}
}
action is no have listener?
every frame check is no good idea
(ps> i don’t want use collision checker. )
cocos creator version : 1.10.2