Modify property on SKNode while moving
I have a subclass of SKNode that acts as my "creature". These move about the scene automatically using SKActions. I'm interested in modifying (decreasing) an 'energy' property (Int) as the creature moves. The creature isn't guaranteed to move the entire length of the move SKAction (it can be interrupted), so calculating the total distance and then decreasing the property as soon as it starts moving isn't ideal. I'd essentially like to say "for every 1 second the node is moving, decrease the energy property". How can I do this? I'm at a loss! Thank you. In your GameScene.swift class you have an