From 9aaa73f06f2f4deb0469fd1c4389b5ef0f1901f7 Mon Sep 17 00:00:00 2001 From: "Z. Cliffe Schreuders" Date: Fri, 15 Aug 2025 00:55:46 +0100 Subject: [PATCH] Refactor lockpicking-game-phaser.js: Rearrange comments for clarity and maintainability. Ensure the drawing logic for the key pin and hook position updates are clearly documented, enhancing code readability without altering functionality. --- .../lockpicking/lockpicking-game-phaser.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/js/minigames/lockpicking/lockpicking-game-phaser.js b/js/minigames/lockpicking/lockpicking-game-phaser.js index 55f85a0..ff2d88f 100644 --- a/js/minigames/lockpicking/lockpicking-game-phaser.js +++ b/js/minigames/lockpicking/lockpicking-game-phaser.js @@ -1492,16 +1492,16 @@ export class LockpickingMinigamePhaser extends MinigameScene { pin.keyPin.clear(); pin.keyPin.fillStyle(0xdd3333); - // Draw rectangular part of key pin - pin.keyPin.fillRect(-12, -50 + pin.driverPinLength - pin.currentHeight, 24, pin.keyPinLength - 8); + // Draw rectangular part of key pin + pin.keyPin.fillRect(-12, -50 + pin.driverPinLength - pin.currentHeight, 24, pin.keyPinLength - 8); - // Update hook position to follow any moving pin - if (pin.currentHeight > 0) { - this.updateHookPosition(pin.index); - } - - // Draw triangular bottom in pixel art style - pin.keyPin.fillRect(-12, -50 + pin.driverPinLength - pin.currentHeight + pin.keyPinLength - 8, 24, 2); + // Update hook position to follow any moving pin + if (pin.currentHeight > 0) { + this.updateHookPosition(pin.index); + } + + // Draw triangular bottom in pixel art style + pin.keyPin.fillRect(-12, -50 + pin.driverPinLength - pin.currentHeight + pin.keyPinLength - 8, 24, 2); pin.keyPin.fillRect(-10, -50 + pin.driverPinLength - pin.currentHeight + pin.keyPinLength - 6, 20, 2); pin.keyPin.fillRect(-8, -50 + pin.driverPinLength - pin.currentHeight + pin.keyPinLength - 4, 16, 2); pin.keyPin.fillRect(-6, -50 + pin.driverPinLength - pin.currentHeight + pin.keyPinLength - 2, 12, 2);