I see that there’s an easy way to do smooth animation using intervals, but when you start an interval, the start function returns immediately and the animation happens in the background. Is there an easy way to animate objects and wait for them to move before continuing the execution of my program?
Can I set up an interval to play for X seconds, start it, and then essentially sleep for X seconds while the interval plays? I’ve tried Python’s time.sleep function, but that doesn’t work. I’m guessing that’s because the Panda3D main loop can’t run while it’s sleeping.
The reason I ask is because I’m writing an turn-based game, and I’d like to animate the movements of the pieces, but (for instance) I don’t want the player’s turn to start while the CPU’s piece is still moving to its new position.