How can I get the FPS

I added shadows to my game and they make it look very nice! Except that when I spawn hundreds of sprites (that get their own shadows) you can imagine that the FPS plummets. So I have a variable that dictates whether I should spawn a shadow with the sprite. How can I get the FPS (like what the simulator says, or what is displayed at the bottom on hardware) so when it dips, say below 30 I turn shadows off?

1 Like

Like a battery-save mode?

1 Like

Or to put it in 6 words: How can I get the FPS?

1 Like

Yea! Except of keeping the :battery:, I’m trying to keep my computer (and PyGamer) from going :fire:.

there is a forever loop that slows when the fps drops so you can do this:
image

1 Like

Ah nice! Very ingenious! Maybe instead of a forever, I’ll use a on game update because that runs every frame!

I’m just wondering if there was a TS command to do something like control.instantFPS().