Formatted codes.

This commit is contained in:
yflu 2022-10-25 23:36:55 +08:00
parent 4e0f7b52d4
commit 8038b393e0
3 changed files with 68 additions and 65 deletions

View File

@ -382,7 +382,8 @@ cc.Class({
window.clearBoundRoomIdInBothVolatileAndPersistentStorage();
window.initPersistentSessionClient(self.initAfterWSConnected, null /* Deliberately NOT passing in any `expectedRoomId`. -- YFLu */ );
};
resultPanelScriptIns.onCloseDelegate = () => {};
resultPanelScriptIns.onCloseDelegate = () => {
};
self.gameRuleNode = cc.instantiate(self.gameRulePrefab);
self.gameRuleNode.width = self.canvasNode.width;
@ -740,9 +741,11 @@ cc.Class({
newPlayerNode.setPosition(cc.v2(x, y));
newPlayerNode.getComponent("SelfPlayer").mapNode = self.node;
const currentSelfColliderCircle = newPlayerNode.getComponent(cc.CircleCollider);
const r = currentSelfColliderCircle.radius, d = 2*r;
const r = currentSelfColliderCircle.radius,
d = 2 * r;
// The collision box of an individual player is a polygon instead of a circle, because the backend collision engine doesn't handle circle alignment well.
const x0 = x-r, y0 = y-r;
const x0 = x - r,
y0 = y - r;
let pts = [[0, 0], [d, 0], [d, d], [0, d]];
const newPlayerColliderLatest = self.latestCollisionSys.createPolygon(x0, y0, pts);