A State Machine Implementation for SpriteKit in Swift