From dd5f7899b9c2776df7ba7d10fdc8e98973d5a5e0 Mon Sep 17 00:00:00 2001 From: Muffin Date: Tue, 15 Aug 2023 21:57:01 -0500 Subject: [PATCH] restore an fps block --- extensions/XeroName/Deltatime.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/extensions/XeroName/Deltatime.js b/extensions/XeroName/Deltatime.js index 9c59e6fcfa..3aefa275ff 100644 --- a/extensions/XeroName/Deltatime.js +++ b/extensions/XeroName/Deltatime.js @@ -45,6 +45,11 @@ I learned how to use "Runtime Steps" of Scratch VM through that code. opcode: 'dt', blockType: Scratch.BlockType.REPORTER, text: 'ΔT' + }, + { + opcode: 'fps', + blockType: Scratch.BlockType.REPORTER, + text: 'fps' } ] }; @@ -53,6 +58,10 @@ I learned how to use "Runtime Steps" of Scratch VM through that code. dt() { return deltaTime; } + + fps() { + return +(1 / deltaTime).toFixed(2); + } } Scratch.extensions.register(new Dt());