These are chat archives for pixijs/pixi.js

22nd
Aug 2016
Antoine Guillien
@Sladix
Aug 22 2016 07:45
Hey all
Is anyone using p2js ?
Ivan Popelyshev
@ivanpopelyshev
Aug 22 2016 09:06
which one p2js
Antoine Guillien
@Sladix
Aug 22 2016 10:29
Ivan Popelyshev
@ivanpopelyshev
Aug 22 2016 10:32
the first thing you have to do is debug renderer, that shows all physic stuff as graphics
Antoine Guillien
@Sladix
Aug 22 2016 10:34
Yeah I already done that
it's better now
g2g will be back to discuss this
Antoine Guillien
@Sladix
Aug 22 2016 12:12
@ivanpopelyshev I guess I'm good with the positions, I didn't saw that the shape position was centered at first
Ivan Popelyshev
@ivanpopelyshev
Aug 22 2016 13:52
that's good
then whats the problem? just synchronize sprite/graphics /whataver you need positions before actual rendering
Antoine Guillien
@Sladix
Aug 22 2016 13:53
Yeah the problem was the offset between my sprite's pivot and the shape center
it seems better now
Ivan Popelyshev
@ivanpopelyshev
Aug 22 2016 13:56
oh
so, basically, you can either set pivot for it
either anchor
pivot is in pixels
if its (20,30) then you are pinning sprite from its 20 pixels left and 30 top
as for acnchor
its relative to texture width and height
(0,0) top-left , (1,1) bottom-right
Antoine Guillien
@Sladix
Aug 22 2016 14:01
yeah that's what I did
But then I don't know how to handle the bullet deletion when they collide with a player or a wall
because I only have access to the p2 body and not my object
Antoine Guillien
@Sladix
Aug 22 2016 16:11
Also, how do I catch the collision between a static body (walls) a a kinetic one (bullets) ?