pnj fix
This commit is contained in:
parent
df3d4e11c3
commit
9dedf15df8
1 changed files with 5 additions and 4 deletions
|
@ -394,19 +394,20 @@ class PNJ{
|
||||||
}
|
}
|
||||||
|
|
||||||
checkCollisions(){
|
checkCollisions(){
|
||||||
|
let colliding = false;
|
||||||
map0Squares.forEach((square) => {
|
map0Squares.forEach((square) => {
|
||||||
if(square.collide(this.x,this.y,this.z))
|
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))
|
if(circle.collide(this.x,this.y,this.z))
|
||||||
{
|
{
|
||||||
return true;
|
colliding = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return false;
|
return colliding;
|
||||||
}
|
}
|
||||||
|
|
||||||
changeDirection(){
|
changeDirection(){
|
||||||
|
|
Loading…
Reference in a new issue