Skip to content

Commit

Permalink
rixxy: fix "measure time" block (#1821)
Browse files Browse the repository at this point in the history
  • Loading branch information
SharkPool-SP authored Dec 27, 2024
1 parent 274642d commit f3187db
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions extensions/rixxyx.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -480,11 +486,8 @@
isMeasure = false;
}
returnTime(args) {
if (isMeasure == true) {
time += 1;
}
return time;
}
}
Scratch.extensions.register(new RixxyX());
})();
})(Scratch);

0 comments on commit f3187db

Please sign in to comment.