Sudden game lag


#1

Hello, I’m new to Flashpunk and i’m liking it very much, but today I encountered a problem.
Also, sorry for my bad English.

When i run the game on Flashdevelop, sometimes it runs at 60fps and sometimes at 15-30fps for some reason. I didn’t change anything in the code. It’s getting annoying to test the game and I would like to know if there is any way to fix this. Thanks.


(Jean) #2

It depends on a lot of things.

Heavy code on an unique frame, number of entities, GC doing heavy work, Flash Player for Debugging that is not as fast as the common one, etc


(Martí Angelats i Ribera) #3

Basically you gave us no information. Only with this we won’t be able to help you.

And what did you mean when you said “I didn’t change anything in the code.”? Are you using an example? If that’s so, which?


#4

I was using the Keyboard and Mouse input examples from here.
But I think I fixed it. I switched from debug to release when running the game and now it’s working normally.
I guess I pressed something that changed that and didn’t notice.


(Jacob Albano) #5

I took that to mean that performance can be different from one run to another, without changing code in the meantime.