10 years ago by foyleman
New to impactjs but not programming.
I'm having trouble understanding the 2D array in collision maps for impact.
I couldn't find details on how the array is setup.
Can someone point me in the right direction or explain it?
example of my player entity:
In the above example, my entire entity still has total collision. I expect a portion of the entity collide.
How is this array representative of the entity?
Am I missing a directive to activate this new collision model?
I'm having trouble understanding the 2D array in collision maps for impact.
I couldn't find details on how the array is setup.
Can someone point me in the right direction or explain it?
example of my player entity:
size: {x: 64, y: 64}, init: function( x, y, settings ) { this.parent( x, y, settings ); var data = [ [0,0,0,0], [0,1,1,0], [0,0,0,0] ]; this.collisionMap = new ig.CollisionMap (8, data); }
In the above example, my entire entity still has total collision. I expect a portion of the entity collide.
How is this array representative of the entity?
Am I missing a directive to activate this new collision model?