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 HammHetfield

Hi all,

I made a script of a little character with some kind of gun, and the animations of him running.

The size that I would like to collide is 20x54px but each element of the sprite is actually 48x54px due to the shotgun on the side.

so I set the size as follow :

side: {x: 20, y: 54},

Then for my AnimationSheet, I use 48, 54. The problem is that instead of being centered, the image is aligned to the top left corner, making something like that : http://imgur.com/pflBD

The area that collides is "outside" of the image of the character.

Is there a workaround for that ? I know I could use 48x54 but the character would sometimes be walking in the air, it's just impossible to play this way.

Hope there's a solution for that, looking the collision and animation pages of the doc didn't help me.

1 decade ago by HammHetfield

Alright well I clearly didn't read the doc carefully enough...

http://impactjs.com/documentation/class-reference/entity#offset-x-offset-y
Page 1 of 1
« first « previous next › last »