can someone review my code, Lock pop1-9-2026_8-17-31.wick (2.8 KB)
Here’s the code its self:
// Initialize score
let score = 0;
this.onMouseDown = function() {
// Calculate shortest angular distance
let diff = Math.abs((indicator.rotation - marker.rotation + 360) % 360);
if (diff > 180) diff = 360 - diff;
if (diff < 10) {
score += 1;
trace("Perfect timing! Score: " + score);
// Randomize marker rotation (0–359 degrees)
marker.rotation = Math.random() * 360;
} else {
trace("Missed! Try again. Score: " + score);
}
};