Taking advnatageof setAnimation with sprites
  • Is it possible to set multiple sprites for the setAnimation method? and can we initiate this method after a certain sprite has been processed (moved across the screen? and if so, how can we do that?

    I'm just trying to get a feel for how to use this method with some kind of example(s).  The documentation mentions using this method with $.gQ.CALLBACK. Any demos of that?

    Thanks!

  • Selim do you have any examples online that specifically use setAnimation with $.gameQuery.ANIMATION_MULTI ?  This way it can be visually clear to see how the 2 interact with each other? I looked through the demos that come with the 0.7 package and couldn't find any.

    Thanks!
    bh


  • selimselim
    Accepted Answer
    You can take a look at the test files :  https://github.com/onaluf/gameQuery/blob/master/tests/human/Animation/type/test1.html . There at line 16 and 17 I define some multi-animations. Then at line 36 to 40 I use setAnimation to change the animation.
  • Thank you so much Selim!  Also, is it possible to begin the animation on any other frame besides the first one of a multiple sprite image?  I tried changing      $("#multiOffsetHorizontal").setAnimation(1); to something like...

         $("#multiOffsetHorizontal").setAnimation(2);

    or
         $("#multiOffsetHorizontal").setAnimation(3);

    but i just get a red box when i do that.


    Thanks!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!