Hi all! First off thanks for this very interesting looking game engine. I've only spent a little time with it so please forgive me if my questions are based on my own mistakes!
Latest version of the game engine (as of last night, github... v3.1.0 in the header comments).
I want to set up a quick demo using some fixed sized sprite-sheets from an old Flash project (Pocket Platoon) but ran into a problem when using the platform tutorial. Digging through the invaders tutorial doesn't give me a good answer either:
I am using two sprite sheets, a soldier run and soldier idle. The cell size is different for each sprite sheet.
I'm using:
game.data.player = me.pool.pull('mainPlayer', 100, 100, { width: 30, height: 45, image:'soldier_a_idle_' })
to create a player object and keep a reference to it. The width/height used here are my desired size for the collision box.
The problem is that the Entity seems to be creating a TextureAtlas object using this width/height. The AnimationSheet system uses that TextureAtlas for it's offset values to dictate where the images are... but these numbers are the collision box dimensions, not the size of the sprites in the AnimationSheet.
It seems like each AnimationSheet should be able to specify its own width/height, and I hacked in a couple of lines in AnimationSheet.init to allow me to pass some through the settings object, then in addAnimation to use those values. But of course this doesn't fix the offset in the TextureAtlas, because that is created by Entity.
Is there a way of adjusting the sprite size for an Entity which is using multiple sprite sheets with different sized cells that I am missing? All of my searches lead me to questions/answers about texture atlases where each cell is a different size and the answer there is to provide information for every cell... which seems overkill for regular sized sprite sheets which only vary by sheet.
If there isn't, may I suggest that each AnimationSheet might create its own offset values based on the dimensions provided for that sheet, instead of relying on a universal value which belongs to the Entity?
(This approach is probably not as common as a Mario type clone where every player sprite is the same dimension, but it is a good compromise to use a fixed size sprite sheet for each separate animation and allow the sizes to vary between sheets. It allows punching animations to be very wide without requiring that standing animations waste a ton of space, and it avoids the overhead of creating and maintaining a full cell-based offset system.)
cheers
Pete