From ec54093fc64b8aa94be009898672179005e942f8 Mon Sep 17 00:00:00 2001 From: EmeraldBlock Date: Wed, 24 Nov 2021 00:15:53 -0600 Subject: [PATCH] update belt comments --- src/js/game/systems/acceptor_belt.js | 4 ++-- src/js/game/systems/belt.js | 2 +- src/js/game/systems/ejector_belt.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/js/game/systems/acceptor_belt.js b/src/js/game/systems/acceptor_belt.js index 9efa36aa..70f8ed45 100644 --- a/src/js/game/systems/acceptor_belt.js +++ b/src/js/game/systems/acceptor_belt.js @@ -8,6 +8,7 @@ import { GameSystemWithFilter } from "../game_system_with_filter"; import { MapChunkView } from "../map_chunk_view"; import { BELT_ANIM_COUNT } from "./belt"; +// nearly identical to systems/ejector_belt.js export class AcceptorBeltSystem extends GameSystemWithFilter { constructor(root) { super(root, [ItemAcceptorComponent]); @@ -25,9 +26,8 @@ export class AcceptorBeltSystem extends GameSystemWithFilter { * @param {MapChunkView} chunk */ drawChunk(parameters, chunk) { - // Limit speed to avoid belts going backwards - const speedMultiplier = Math.min(this.root.hubGoals.getBeltBaseSpeed(), 10); // SYNC with systems/belt.js:drawChunk! + const speedMultiplier = Math.min(this.root.hubGoals.getBeltBaseSpeed(), 10); const animationIndex = Math.floor( ((this.root.time.realtimeNow() * speedMultiplier * BELT_ANIM_COUNT * 126) / 42) * globalConfig.itemSpacingOnBelts diff --git a/src/js/game/systems/belt.js b/src/js/game/systems/belt.js index c083df24..8912d098 100644 --- a/src/js/game/systems/belt.js +++ b/src/js/game/systems/belt.js @@ -494,9 +494,9 @@ export class BeltSystem extends GameSystemWithFilter { * @param {MapChunkView} chunk */ drawChunk(parameters, chunk) { + // SYNC with systems/acceptor_belt.js:drawChunk and systems/ejector_belt.js:drawChunk! // Limit speed to avoid belts going backwards const speedMultiplier = Math.min(this.root.hubGoals.getBeltBaseSpeed(), 10); - // SYNC with systems/belt_underlays.js:drawChunk! // 126 / 42 is the exact animation speed of the png animation const animationIndex = Math.floor( ((this.root.time.realtimeNow() * speedMultiplier * BELT_ANIM_COUNT * 126) / 42) * diff --git a/src/js/game/systems/ejector_belt.js b/src/js/game/systems/ejector_belt.js index 0955e570..fcbb869a 100644 --- a/src/js/game/systems/ejector_belt.js +++ b/src/js/game/systems/ejector_belt.js @@ -8,6 +8,7 @@ import { GameSystemWithFilter } from "../game_system_with_filter"; import { MapChunkView } from "../map_chunk_view"; import { BELT_ANIM_COUNT } from "./belt"; +// nearly identical to systems/acceptor_belt.js export class EjectorBeltSystem extends GameSystemWithFilter { constructor(root) { super(root, [ItemEjectorComponent]); @@ -25,9 +26,8 @@ export class EjectorBeltSystem extends GameSystemWithFilter { * @param {MapChunkView} chunk */ drawChunk(parameters, chunk) { - // Limit speed to avoid belts going backwards - const speedMultiplier = Math.min(this.root.hubGoals.getBeltBaseSpeed(), 10); // SYNC with systems/belt.js:drawChunk! + const speedMultiplier = Math.min(this.root.hubGoals.getBeltBaseSpeed(), 10); const animationIndex = Math.floor( ((this.root.time.realtimeNow() * speedMultiplier * BELT_ANIM_COUNT * 126) / 42) * globalConfig.itemSpacingOnBelts