KSwift Swift + SpriteKit + StateMachine Example Click (tap) to change states. Sitting becomes laying after three seconds. Laying becomes sleeping after another three seconds.