Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by mickey

my entities has its animation sheets spread into multiple image files.

can you tell me how i can setup my entity so it can have multiple animation sheets and play them all in sequence?

also my animation sheets are 2048x2048 by size, and each frame is 512x512 - so a total of 16 frame per spritesheet, will that pose a performance problem for mobile safari/ipad ?

1 decade ago by jorasso

I have heard that Safari on iPhone works only with textures up to 1024x1024. With sizes bigger than this it won't work.

If you want to have a couple of spritesheets per Entity, the only thing you need is change animSheet property of Entity before defining animations, which use this particular AnimationSheet.

1 decade ago by mickey

thanks for trying to help.

I'm not sure what you meant but instead of touching the animSheet as you suggested, i created a list of animations on my derived entity class:

this.animations.push(new ig.Animation( this.animSheets[0], 0.035, createNumArray(32), true ));
this.animations.push(new ig.Animation( this.animSheets[1], 0.035, createNumArray(32), true ));

and then during update i do something like this:

this.currentAnim = this.animations[this.currentAnimSheetIndex];
this.currentAnim.rewind();

As you can see from here on i never use the animSheet property anymore but just change the currentAnim.

But this leads to a spike on the mobile device - whenever the currentAnim changes to a new one - there's a spike/stop on the mobile device - making the game not fluid anymore.

Otherwise please elaborate in code details if you can with your suggestion and i would like to try it.

1 decade ago by jorasso

The way you do it is ok. My idea would works exactly the same, and there would be no increase in performance.

You mentioned that your animation frame is 512x512. It is very huge. So what is the size of canvas in your game? Can you show your game? It would be useful to help you and suggest some solution to make it working better on mobiles.

And what mobile devices and browsers do you target?
Page 1 of 1
« first « previous next › last »