askariwa Posted May 10, 2014 Share Posted May 10, 2014 I have searched on web but i didn't found anything useful so i am trying here for a tip.I want to make a game where i can handle a collision between a predefined game object (a sprite) and a dynamically shaped object, like the crate and the curve in the image attached to this post.I want to be able to change the curve charateristics programatticaly and still get the colision events with the game sprites. I was thinking about trying to do the checking on an off-screen canvas but i didn't find any kind of tutorial on this in any kind of game engine. Could it be possible doing it with Phaser ? Thanks in advance Link to comment Share on other sites More sharing options...
CtlAltDel Posted May 11, 2014 Share Posted May 11, 2014 The P2 physics engine included in Phaser can do this. Link to comment Share on other sites More sharing options...
stasuss Posted May 11, 2014 Share Posted May 11, 2014 http://www.html5gamedevs.com/topic/6239-paint-in-a-game/ PS: you can use any physics engine with the created sprite Link to comment Share on other sites More sharing options...
CtlAltDel Posted May 11, 2014 Share Posted May 11, 2014 Not quite true, P2 is the only one in phaser that can do the circle checking. Arcade is pure AABB Link to comment Share on other sites More sharing options...
stasuss Posted May 11, 2014 Share Posted May 11, 2014 May be he does not need precise checking) Link to comment Share on other sites More sharing options...
valueerror Posted May 11, 2014 Share Posted May 11, 2014 as far as i understood he needs even more precise collision detection.. if he want's to dynamically change the shape a circle will not do it.. and what if the box comes from the other side of this curve? i'd say this is a job for a polygon and can only be done with p2 physics - but when the shape changes you would have to change the polygon body too.. thats **** hard to do! another approach (given i understood right and you want the exact collision body for this "bow shape") would be to make this shape out of several small sprites linked together with a constraint and then just change the positions of these (static) mini bodies -- and the collision shapes will change automatically with them.. i'm thinking of something like this - just without the physics determining the movement.. http://test.xapient.net/phaser/ALL/chain.html Link to comment Share on other sites More sharing options...
Recommended Posts