void Bullet::move(float tm)
{
checkNearestEnemy();
if(nearestEnemy != NULL)
{
this->setVisible(true);
auto moveDuration = nearestEnemy->getPosition();
auto move = MoveTo::create(0.5f, moveDuration);
this->runAction(move);
}
}
```
比如像这样,但当子弹打不中敌人的时候,子弹会到处乱飞,求解决
打不中时候飞走是飞出屏幕外面吗?
如果是的话就用MoveBy让子弹飞到屏幕外面吧。
记得在适当的时候销毁子弹