ios - How to make changes to SKActions periodically? -


i want change speedofrectangle after spawning few rectangles(skshapenodes).

func wait(factor: cgfloat = 1) -> skaction {     return skaction.waitforduration(nstimeinterval(rectheight * speedofrectangle * distancebetweenrectangles / factor)) }  let spawnsequence = skaction.sequence([wait(), increasecounter, spawnaction]) let spawnsequenceforever = skaction.repeatactionforever(spawnsequence)  worldnode.runaction(spawnsequenceforever) 

how make changes skactions periodically?

the easiest way change action remove old action , create new one. can remove actions removing "key" or remove actions running on node removeallactions().

changing actions while running has no effect until action completed , run again.

hope helped , luck.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -