tonky Posted April 10, 2016 Share Posted April 10, 2016 I am making a game that uses physics joints (can be p2 but for this I am using box2d joints). Currently, I am showing the joints using debug but I would like to polish the joint and use either a spritesheet or particles. Has anyone got any pointers for this? Link to comment Share on other sites More sharing options...
Tom Atom Posted April 10, 2016 Share Posted April 10, 2016 Hi, do not use anything related to debug in your final game. Debug features are only for development and can have really significant performance hits if you leave it in release... For (non-debug) showing joints in game you will have to create some system, that will draw it for you independently on debug features. You can check source for ways how debug draws it and repeat it in your game with sprites or particles. For example: you can make small class that will paint sprite between two points and use it instead of line drawing (get two end points, calculate atan2 to get angle between them, calculate length of vector between them, set width of joint sprite to this length and its angle to calculated angle) tonky 1 Link to comment Share on other sites More sharing options...
tonky Posted April 10, 2016 Author Share Posted April 10, 2016 Thanks. I think phaser's bitmapdata and line and graphics drawing features might also aid me in this. Link to comment Share on other sites More sharing options...
Recommended Posts