我试图在SK/SWIFT中给精灵添加“脉动”效果。我尝试使用for循环和`.setScale`,但它们没有起作用(没有错误,只是没有动画效果)。我感觉使用SKActions可能更加优雅。
在参考下面的帮助后,这是我的当前实现。然而,它出现了编译错误:
“Expected member name or constructor call after type name &;Consecutive statement on a line must be separated by a ;”
这是我正在使用的代码:
在参考下面的帮助后,这是我的当前实现。然而,它出现了编译错误:
“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]
任何帮助都将不胜感激。
sprite-kit
吗?CCSprite 和 CCSequence 等都是 cocos2d 的类,对吧? - Anthony Kong