Collision with tiles

edited August 2012 in Development
Hello,

I can't figure out how to check if my player runs into a tile generated by the Tile Map Editor.

I tried to check if my player collides with the tileType 1:

var collided = $("#player").collision("#tilemap,."+ $.gameQuery.tileTypePrefix + 1 );
if(collided.length > 0){
...
}


Comments

  • I've got the same problem.

    $("#player").collision("#tilemap, .gQ_tileType_0").each(function(){
    alert("Success");
    });
  • Is your tile-map directly under the playground or is it nested in a group?
  • It is directly under it.
    $.playground().addTilemap('tilemap', map,  animations, {width: 30, height: 30, sizex: 100, sizey: 100});
  • do you move any of your game elements directly (like for example with .css()) without using gQ own functions (like .x() )?
Sign In or Register to comment.