Jump to content

Drawing on the canvas + collide/physics


Recommended Posts

Hi fellow Phasers!



I'm building a game where you draw on the screen to catch particles. I've got the drawing happening, however the new drawings do not collide with the particles. 


I've extended the 'multiball.js' demo with drawing implemented & attached to give you an idea of what's happening.

Take a look here (and draw on the screen!): http://jsbin.com/laruveni/1/edit?js,output


If I add in the update() function:


game.physics.arcade.collide(drawing, balls, null, reflect, this);


Then the particles collide with the bitmap data canvas (which is the size of the stage), rather than the actual drawing.


Any advice would be appreciated!


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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