Jump to content

Collision between sprite and bitmap not working

mike perry

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')

And bitmap:

this.bmd = this.game.add.bitmapData(2000, 2000)

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:


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


  • Recently Browsing   0 members

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