Removed off screen bullets that was causing lag
This commit is contained in:
@@ -45,7 +45,9 @@ class bullet {
|
||||
} else if (this.projectile.x < 0 - 10 || this.projectile.x > width + 10 || this.projectile.y < 0 - 10 || this.projectile.y > height + 10) {
|
||||
shot = false;
|
||||
}
|
||||
let isOffScreen = this.projectile.x < 0 || this.projectile.x > width || this.projectile.y < 0 || this.projectile.y > height;
|
||||
|
||||
return { hit, shot };
|
||||
|
||||
return { hit, shot, isOffScreen};
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user