我們知道SpriteKit的action中提供了兩種wait action。一種是通過waitForDuration:來等待一個確定的時間,另一種是通過waitForDuration:withRange:來等待一個隨機的時間。這個隨機的時間的範圍由兩個參數確定:duration表徵平均值,range表徵區間大小。
For example if you set duration to 5.0 and range to 2.0 you will get wait times between 4.0 and 6.0
對於duration爲5,range爲2的隨機等待時間,位於4.0和6.0之間。
參考:
http://stackoverflow.com/questions/21849431/sprite-kit-skaction-repeatactionforever-random-wait-duration