Answer the question
In order to leave comments, you need to log in
How to add collision handling to Pixi.js?
Made animation on Canvas using Pixi.js. I really enjoyed working with him. Almost everything is intuitive. I made an animation, everything is spinning, spinning. But now the task is to process several collisions. But in Pixi this doesn't seem to be the case... I don't want to use and learn another framework :) I watched Phaser, but it's very huge and not intuitive... I decided to bypass it. What do you advise? Thanks in advance!
Answer the question
In order to leave comments, you need to log in
Of course not, it's purely a graphics engine. And for physics you need a physical one .
Wrote a function just to detect rectangle-rectangle collisions. Solve problems! ))
function checkForCollision(obj1, obj2){
if ((obj1.x < obj2.x + obj2.width) && (obj2.x < obj1.x + obj1.width) && (obj1.y < obj2.y + obj2.height) && (obj2.y < obj1.y + obj1.height)) return true;
return false;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question