Jump to content

Overlap with Ninja Physics


Recommended Posts

hey, again i'm lost with Ninja Physics :wacko:  

i have a map of objects which could be collected by a player

gpObjs   = game.add.group();game.physics.ninja.enable(gpObjs);   map.createFromObjects('objs', 42, 'coin', 0, true, false, gpObjs);map.setTileIndexCallback(42, this.onHit, this);gpObjs.forEach(function(item) {   game.physics.ninja.enableBody(item);    item.body.immovable = true;})

on the update(), i did not manage to detect overlap, it's always false

var hit = game.physics.ninja.overlap (player, gpObjs, onHit, null, this);

what's wrong with my code ?

did i use convertTileMap() instead of createFromObjects() ?

i read i can't use collisionGroup with ninja but i can use Group ?


Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...