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.

This commit is contained in:
Z. Cliffe Schreuders
2025-08-15 00:55:46 +01:00
parent 38c2a0476f
commit 9aaa73f06f

View File

@@ -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);