mike perry Posted August 30, 2018 Share Posted August 30, 2018 How to detect collision between sprite and shape created by bitmap? In example I have sprite: this.player = this.add.sprite(0, 0, 'player') this.player.anchor.setTo(0.5) this.player.scale.setTo(0.1) And bitmap: this.bmd = this.game.add.bitmapData(2000, 2000) this.bmd.addToWorld() And then I draw shape using bmd object: this.bmd.rect(px, py + 15, 5, 500, 'rgba(255, 255, 255, 1)') Then I call this method: this.bmd.update() It looks more or less like in image. Yellow ball is my sprite. White curved line is my shape created from bitmapdata. And I want detect collision between yellow object and white line. Link to comment Share on other sites More sharing options...
mike perry Posted August 30, 2018 Author Share Posted August 30, 2018 I solved it - this example is very helpful http://jsfiddle.net/4yh8ee1f/46/ Link to comment Share on other sites More sharing options...
Recommended Posts