Define cell into cell1
Then do the following:
// move player cells this.updateRemerge(cell1, client); this.moveCell(cell1); this.movePlayer(cell1, client); this.autoSplit(cell1, client); <----- find this part. this.updateNodeQuad(cell1);
Do a line break between this.autoSplit and this.uppdateNodeQuad
so:
`this.autoSplit (cell1, client);
this.updateNodeQuad(cell1); paste in the line break: this.quadTree.find(cell.quadItem.bound, function(check) {
if (check.cell === cell) return;
var m = self.checkCellCollision(cell, check.cell);
if (self.checkRigidCollision(m)) {
self.resolveRigidCollision(m);
processedEats++;
}
});`
this.quadTree.find(cell.quadItem.bound, function(check) {
if (check.cell === cell) return;
var m = self.checkCellCollision(cell, check.cell);
if (self.checkRigidCollision(m)) {
self.resolveRigidCollision(m);
processedEats++;
}
});
this.updateNodeQuad(cell1);
// Scan for player cells collisions`
Define
cell
intocell1
Then do the following:// move player cells this.updateRemerge(cell1, client); this.moveCell(cell1); this.movePlayer(cell1, client); this.autoSplit(cell1, client); <----- find this part. this.updateNodeQuad(cell1);
Do a line break between this.autoSplit and this.uppdateNodeQuad so: `this.autoSplit (cell1, client);
this.updateNodeQuad(cell1);
paste in the line break:
this.quadTree.find(cell.quadItem.bound, function(check) { if (check.cell === cell) return; var m = self.checkCellCollision(cell, check.cell); if (self.checkRigidCollision(m)) { self.resolveRigidCollision(m); processedEats++; } });`So basically do it like this:
` // move player cells this.updateRemerge(cell1, client); this.moveCell(cell1); this.movePlayer(cell1, client); this.autoSplit(cell1, client);