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
@ -1080,9 +1080,9 @@ func (pR *Room) prefabInputFrameDownsync(inputFrameId int32) *pb.InputFrameDowns
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (pR *Room) markConfirmationIfApplicable() {
|
func (pR *Room) markConfirmationIfApplicable() {
|
||||||
inputFrameId1 := pR.LastAllConfirmedInputFrameId+1
|
inputFrameId1 := pR.LastAllConfirmedInputFrameId + 1
|
||||||
gap := int32(4) // This value is hardcoded and doesn't need be much bigger, because the backend side is supposed to never lag when "false == BackendDynamicsEnabled".
|
gap := int32(4) // This value is hardcoded and doesn't need be much bigger, because the backend side is supposed to never lag when "false == BackendDynamicsEnabled".
|
||||||
inputFrameId2 := inputFrameId1+gap
|
inputFrameId2 := inputFrameId1 + gap
|
||||||
if inputFrameId2 > pR.InputsBuffer.EdFrameId {
|
if inputFrameId2 > pR.InputsBuffer.EdFrameId {
|
||||||
inputFrameId2 = pR.InputsBuffer.EdFrameId
|
inputFrameId2 = pR.InputsBuffer.EdFrameId
|
||||||
}
|
}
|
||||||
|
@ -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