This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-01-02 05:12:24

WeirdF
Scratcher
Registered: 2009-05-31
Posts: 1000+

Frames Per Second Counter

I was just wondering if anyone knows of a way to do an fps counter in Scratch by using the timer or something like that.

There has already been a topic about this, but I can't seem to find it.


http://i.cr3ation.co.uk/dl/s1/gif/847032b8a331def77529b6a0384db1fe_handfingers.gif

Offline

 

#2 2010-01-02 07:13:18

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: Frames Per Second Counter

I think a way would be repeating [change [variable] by (1)] until a second passes, display the result and reset the variable, then repeat. I'll try it out now to see if it works.

EDIT: Done, here it is.

Last edited by technoguyx (2010-01-02 07:29:31)


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#3 2010-01-02 07:43:26

WeirdF
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Frames Per Second Counter

technoguyx wrote:

I think a way would be repeating [change [variable] by (1)] until a second passes, display the result and reset the variable, then repeat. I'll try it out now to see if it works.

EDIT: Done, here it is.

Yay! Thank you!


http://i.cr3ation.co.uk/dl/s1/gif/847032b8a331def77529b6a0384db1fe_handfingers.gif

Offline

 

#4 2010-01-02 10:04:55

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: Frames Per Second Counter

Yes, I implemented that in a game I was making and it reduced graphic effects like ghost etc if the fps dropped to much  smile


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#5 2010-01-02 11:38:55

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Frames Per Second Counter

WeirdF wrote:

technoguyx wrote:

I think a way would be repeating [change [variable] by (1)] until a second passes, display the result and reset the variable, then repeat. I'll try it out now to see if it works.

EDIT: Done, here it is.

Yay! Thank you!

The only thing with his project, is that it doesn't use the timer. I reccomend using the timer as it is a lot more accurate. And instead of recalibrating every second, have it every 5 seconds or something...


http://i.imgur.com/WBkM2QQ.png

Offline

 

#6 2010-01-02 13:43:03

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: Frames Per Second Counter

Lucario621 wrote:

The only thing with his project, is that it doesn't use the timer. I reccomend using the timer as it is a lot more accurate. And instead of recalibrating every second, have it every 5 seconds or something...

I'll try to implement the timer later, didn't know it was more accurate.

EDIT: Done.

Last edited by technoguyx (2010-01-02 18:09:52)


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

Board footer