实例化出来的多个角色需要在敌人和基地之间无限的重复移动,向敌人移动的动作是
this.toEnemyAction = cc.tween(this.node)
.to(this.moveDistance / this.speed, { position: this.enemyPos })
.start()
向基地移动的动作是
this.toHomeAction = cc.tween(this.node)
.to(this.moveDistance / this.speed, { position: this.spawnPoint.position })
.start()
现在想实现的是在点击每个角色之后,该角色会加速移动,持续几秒钟,然后恢复正常的速度。
我用cc.speed包action实现了加速效果,但是有废除提示,就很难受。
我搜了帖子,对于点击加速,有个_finalAction但貌似是私有变量?应该怎么实现加速效果?
还有点击事件应该用什么方法?
如果用action实现的话,cc.sequence类型又不对了。。
let toEnemy = cc.speed(this.toEnemyAction, 2);
let toHome = cc.speed(this.toHomeAction , 2);
ler seq = cc.sequence(toEnemy,toHome);
