Hi Kovas,

how about state machine for this?
To each state assing an animation. Next simply render 
current_state.animation and switch states.

W dniu niedziela, 23 września 2018 18:45:42 UTC+2 użytkownik 
kovas....@gmail.com napisał:
>
> Hi all,
>
> What is the best/intended way to trigger sprite animations when something 
> happens?  For instance, if I have a character sprite in a game with some 
> looping idle animation, how do I make that sprite change from the idle 
> animation to an attack animation, then go back to idle when it is 
> finished?  Can this all be done in the Sprite class?  
>
> Apologies if this has been asked before - I wasn't able to find anything 
> in my quick searching.  
>
>  - Kovas
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyglet-users+unsubscr...@googlegroups.com.
To post to this group, send email to pyglet-users@googlegroups.com.
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to