Alexandre58 Posted February 12, 2021 Share Posted February 12, 2021 Hello, I have a problem with my pixiJS App, i have many sprites that I can move in my scene and my goal and create a plan with collisions between sprites, for that I use the bump plugin and the rectangleCollision fuuntion :https://github.com/kittykatattack/bump/ let collision = b.rectangleCollision(selectCont,c2,true,false,true); It's works (the middle case on the pic)if my sprite have no rotation but if i want to apply a rotation on my sprite the collisions doesen't work (left and right case in the pic). I thnik it's a problem with sprite bounds but i have no idea. Can you help me please ? ? Quote Link to comment Share on other sites More sharing options...
Alexandre58 Posted February 15, 2021 Author Share Posted February 15, 2021 Sorryt i don't have write all my script I have an array with all my sprite and i have a function when i do a right click on sprite it apply a rotation and when i wan't to apply my rotation it's work but my collision is not correct for (var j = 0; j < cont.length; j++) { var c2 = cont[j]; b.contain(c2, {x: 0, y: 0, width: 2400, height: 1800}, true); if(selectCont!=c2){ if(activeCollision == true){ let collision = b.hit(selectCont,c2,endCollision,false,true); } } } //function to apply a rotation to sprite function rotate(){ this.rotation -= Math.PI/4; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.