我试图在SK / SWIFT中“脉冲”一个精灵.我尝试使用For循环和.setScale是粗略的,但它们没有工作(没有错误 – 只是没有动画).我觉得使用SKActions可能会更优雅.
在使用下面的帮助后,这是我目前的实施.但是,它出现了编译错误;
Expected member name or constructor call after type name &
Consecutive statement on a line must be separated by a ;
这是我正在使用的代码:
SKAction *pulseUp = [SKAction.scaleto(3.0,duration: 3.0)] SKAction *pulseDown = [SKAction.scaleto(1.0,duration: 3.0)] SKAction *pulse = [SKAction.sequence(pulseUp,pulseDown)] SKAction *repeat = [SKAction repeatActionForever:pulse]] [self.playButton runAction: repeat]
任何帮助将不胜感激.