1
Graphics / Managing multiple animations
« on: December 03, 2015, 01:49:14 am »
Hey all,
I'm working on a project at the moment which visualises sort algorithms to demonstrate how they differ in handling the sort problem. This requires a lot of on-screen animation, but vitally, takes in no user input. I'm pretty new to SFML, so I was wondering what's the best approach to handling the animation of each element on the screen?
The elements (each are sprites), will be moved one after another to show the process of sorting. Then once sorted, the sprite will be highlighted green; this has already been implemented. The problem is with all the animations playing at the same time, apposed to first animation, pause, second animation, pause etc...
Originally I though of using threads (coming from a currency programming background), but the SFML tutorials suggest to not use threads to handle graphics. So would you suggest using state machines to achieve this?
Any document/references will be most helpful - or your opinion on how you would go about implementation.
I'm working on a project at the moment which visualises sort algorithms to demonstrate how they differ in handling the sort problem. This requires a lot of on-screen animation, but vitally, takes in no user input. I'm pretty new to SFML, so I was wondering what's the best approach to handling the animation of each element on the screen?
The elements (each are sprites), will be moved one after another to show the process of sorting. Then once sorted, the sprite will be highlighted green; this has already been implemented. The problem is with all the animations playing at the same time, apposed to first animation, pause, second animation, pause etc...
Originally I though of using threads (coming from a currency programming background), but the SFML tutorials suggest to not use threads to handle graphics. So would you suggest using state machines to achieve this?
Any document/references will be most helpful - or your opinion on how you would go about implementation.