zoosrc Posted May 3, 2014 Share Posted May 3, 2014 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 More sharing options...
codevinsky Posted May 5, 2014 Share Posted May 5, 2014 so you're probably going to need to setup line-intersection detection. http://docs.phaser.io/Phaser.Line.html Keep a cache of the points you've drawn to, and then test the lines against the bounding boxes of the particles. Link to comment Share on other sites More sharing options...
Recommended Posts