This commit is contained in:
Killian Marty 2024-01-01 12:42:23 +01:00
parent df3d4e11c3
commit 9dedf15df8

View file

@ -394,19 +394,20 @@ class PNJ{
}
checkCollisions(){
let colliding = false;
map0Squares.forEach((square) => {
if(square.collide(this.x,this.y,this.z))
{
return true;
colliding = true;
}
});
circles.forEach((circle) => {
map0Circles.forEach((circle) => {
if(circle.collide(this.x,this.y,this.z))
{
return true;
colliding = true;
}
});
return false;
return colliding;
}
changeDirection(){