michalbe/mibbu — Issue #13: hit assignment problem
Author: nerkn
Created: 2011-11-24 13:30:56+00:00
State: open

I defined 4 platform which our hero will run on,
this snipped wont work

for(var i=0;i<4;i++){
sprite.hit(wall2[i], spriteColl)
}

but this works

for(var i=0;i<4;i++){
wall2[i].hit(sprite, spriteColl)
}

spriteColl is collusion function.

spriteColl = function(){
sprite.d*=-1 ;
};

error is p2 undefined in mibbu.js line 260

258 for(element in MB_collides[loopIndex].hits){
259 p2 = MB_fixedIndexColl[element];
260 p2Top = p2.posY + p2.cZ.t;