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