1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Support dynamic tick rates

This commit is contained in:
tobspr
2020-05-18 12:53:01 +02:00
parent 65529cce1a
commit ca0e17f3dd
16 changed files with 265 additions and 114 deletions

View File

@@ -62,7 +62,7 @@ export class UndergroundBeltComponent extends Component {
return false;
}
this.pendingItems.push([item, 1 / beltSpeed / globalConfig.itemSpacingOnBelts]);
this.pendingItems.push([item, 0]);
return true;
}
@@ -88,7 +88,8 @@ export class UndergroundBeltComponent extends Component {
// NOTICE:
// This corresponds to the item ejector - it needs 0.5 additional tiles to eject the item.
// So instead of adding 1 we add 0.5 only.
const travelDuration = (travelDistance + 0.5) / beltSpeed / globalConfig.itemSpacingOnBelts;
// Additionally it takes 1 tile for the acceptor which we just add on top.
const travelDuration = (travelDistance + 1.5) / beltSpeed / globalConfig.itemSpacingOnBelts;
this.pendingItems.push([item, travelDuration]);