Jump to content

Phaser bmd collision?


The_dude8080
 Share

Recommended Posts

Hello. I created a wall bmd that is colliding with a movable square bmd. The collision is detected by the getPixel method that checks for pixel color properties. However even when both bmd are far from each other and the square is in the same y coordinates as the square bmd they collide. However when they are distant from each other and the square is not "contained" in the same y coordinates (height) of the wall they do not collide. Any idea?

the_wall_bmd = game.add.bitmapData(game_width, game_height);
the_wall_bmd.ctx.beginPath();
the_wall_bmd.ctx.rect(0, 200, 100, 200);
the_wall_bmd.ctx.fillStyle = '#FFA07A';
the_wall_bmd.ctx.fill();
the_wall_bmd.update(); 
the_wall = game.add.sprite(0,0,the_wall_bmd, 0,wall_group);

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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