Discuss Scratch

Ocean12021
Scratcher
40 posts

FPS counter

Every once and a while I'll find a game that shows you your FPS. Do things actually work of is it just a random number code because to code that I think it will be like a whole nother project. Just wondering if anyone knows the truth of those things.
Za-Chary
Scratcher
1000+ posts

FPS counter

It's not too hard — there is a tutorial on the Scratch Wiki here that explains how to do it: https://en.scratch-wiki.info/wiki/Making_an_FPS_Counter
BluePixelLOLLL
Scratcher
1000+ posts

FPS counter

Za-Chary wrote:

It's not too hard — there is a tutorial on the Scratch Wiki here that explains how to do it: https://en.scratch-wiki.info/wiki/Making_an_FPS_Counter
Oh yes, “its not too hard”

Me who doesn't understand anything on the page: O_o
LaughabIe
Scratcher
100+ posts

FPS counter

BluePixelLOLLL wrote:

Oh yes, “its not too hard”

Me who doesn't understand anything on the page: O_o
you don’t have to scroll that far to find out that fps counters are pretty simple to make primitively. it really is not that hard.
Whatdidyousay245
Scratcher
100+ posts

FPS counter

when green flag clicked
forever
fps (timesincelastfrane)
end
define fps (input)
set [timesincelastframe v] to ((timer) * (30)
set [fps v] to (round ((30) / ((timesincelastframe) - (input)))) //show fps variable

here's the code in text if you wanna share it:

[scratchblocks
when green flag clicked
forever
fps (timesincelastfrane)
end
define fps (input)
set to ((timer) * (30)
set to (round ((30) / ((timesincelastframe) - (input)))) //show fps variable
[/scratchblocks

put a ] on the end of both scratchblocks text. didn't add them to prevent the text from turning into scratchblocks
colinmacc
Scratcher
1000+ posts

FPS counter

Whatdidyousay245 wrote:

when green flag clicked
forever
fps (timesincelastfrane)
end
define fps (input)
set [timesincelastframe v] to ((timer) * (30)
set [fps v] to (round ((30) / ((timesincelastframe) - (input)))) //show fps variable

here's the code in text if you wanna share it:

[scratchblocks
when green flag clicked
forever
fps (timesincelastfrane)
end
define fps (input)
set to ((timer) * (30)
set to (round ((30) / ((timesincelastframe) - (input)))) //show fps variable
[/scratchblocks

put a ] on the end of both scratchblocks text. didn't add them to prevent the text from turning into scratchblocks

That's very neat actually! Nice one.
Za-Chary
Scratcher
1000+ posts

FPS counter

BluePixelLOLLL wrote:

Za-Chary wrote:

It's not too hard — there is a tutorial on the Scratch Wiki here that explains how to do it: https://en.scratch-wiki.info/wiki/Making_an_FPS_Counter
Oh yes, “its not too hard”

Me who doesn't understand anything on the page: O_o
Neither do I, but it's not too difficult to copy the scripts and call it a day. As long as one understands what a FPS number actually means, copying the scripts can be worth their time.
Ocean12021
Scratcher
40 posts

FPS counter

OH WOW that is easy
Josepepo6
Scratcher
3 posts

FPS counter

This is how I do the FPS counter for my games:
when green flag clicked
hide list [FPS counter]
hide variable [FPS]
delete all of [FPS counter]
add [1] to [FPS counter]
forever
add ((item (length of [FPS counter] :: list) of [FPS counter] :: list)+ (1)) to [FPS counter]
if <(timer) > [0.99]> then
set [FPS] to (length of [FPS counter] :: list)
delete all of [FPS counter]
reset timer
end
end
everwinner64
Scratcher
1000+ posts

FPS counter

Josepepo6 wrote:

This is how I do the FPS counter for my games:
when green flag clicked
hide list [FPS counter]
hide variable [FPS]
delete all of [FPS counter]
add [1] to [FPS counter]
forever
add ((item (length of [FPS counter] :: list) of [FPS counter] :: list)+ (1)) to [FPS counter]
if <(timer) > [0.99]> then
set [FPS] to (length of [FPS counter] :: list)
delete all of [FPS counter]
reset timer
end
end
Don’t necropost please
cosmosaura
Scratch Team
1000+ posts

FPS counter

Topic closed due to necroposting.

Powered by DjangoBB