Jump to content

Collision between sprite and bitmap not working


mike perry
 Share

Recommended Posts

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.

Bez tytułu.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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