mirror of
https://github.com/genxium/DelayNoMore
synced 2025-06-03 08:04:29 +00:00
Formatted codes.
This commit is contained in:
parent
4e0f7b52d4
commit
8038b393e0
@ -382,7 +382,8 @@ cc.Class({
|
|||||||
window.clearBoundRoomIdInBothVolatileAndPersistentStorage();
|
window.clearBoundRoomIdInBothVolatileAndPersistentStorage();
|
||||||
window.initPersistentSessionClient(self.initAfterWSConnected, null /* Deliberately NOT passing in any `expectedRoomId`. -- YFLu */ );
|
window.initPersistentSessionClient(self.initAfterWSConnected, null /* Deliberately NOT passing in any `expectedRoomId`. -- YFLu */ );
|
||||||
};
|
};
|
||||||
resultPanelScriptIns.onCloseDelegate = () => {};
|
resultPanelScriptIns.onCloseDelegate = () => {
|
||||||
|
};
|
||||||
|
|
||||||
self.gameRuleNode = cc.instantiate(self.gameRulePrefab);
|
self.gameRuleNode = cc.instantiate(self.gameRulePrefab);
|
||||||
self.gameRuleNode.width = self.canvasNode.width;
|
self.gameRuleNode.width = self.canvasNode.width;
|
||||||
@ -740,9 +741,11 @@ cc.Class({
|
|||||||
newPlayerNode.setPosition(cc.v2(x, y));
|
newPlayerNode.setPosition(cc.v2(x, y));
|
||||||
newPlayerNode.getComponent("SelfPlayer").mapNode = self.node;
|
newPlayerNode.getComponent("SelfPlayer").mapNode = self.node;
|
||||||
const currentSelfColliderCircle = newPlayerNode.getComponent(cc.CircleCollider);
|
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.
|
// 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]];
|
let pts = [[0, 0], [d, 0], [d, d], [0, d]];
|
||||||
|
|
||||||
const newPlayerColliderLatest = self.latestCollisionSys.createPolygon(x0, y0, pts);
|
const newPlayerColliderLatest = self.latestCollisionSys.createPolygon(x0, y0, pts);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user