diff --git a/extensions/rixxyx.js b/extensions/rixxyx.js index df67b10712..a8a4799e0f 100644 --- a/extensions/rixxyx.js +++ b/extensions/rixxyx.js @@ -9,13 +9,19 @@ * This file is available under an informal "use with credit" license. */ -(function () { +(function (Scratch) { "use strict"; var count = 0; var isMeasure = false; var time = 0; + Scratch.vm.runtime.on("AFTER_EXECUTE", () => { + if (isMeasure) { + time += 1; + } + }); + class RixxyX { getInfo() { return { @@ -480,11 +486,8 @@ isMeasure = false; } returnTime(args) { - if (isMeasure == true) { - time += 1; - } return time; } } Scratch.extensions.register(new RixxyX()); -})(); +})(Scratch);