I'm sorry for this pretty vague question, but i'm a bit helpless here...
When my game starts, it creates various layers, scrolling_managers, it generates a random landscape and about a thousand sprites and loads a large background. I understand this can take time.
But what's troubling me is that the update() function of my character (which is scheduled), receives this elapsed time parameter :
1st time : 0
2nd time : 0.059187720199 which isn't that a big problem
3d time : 1.53404387161 which is really long
4th time : 0.00426641644389
and then it's always something like 0.00177292282634
The real problem with this 1.5sec is that much should happen during this time, and no collision is tested and the character teleports to strange places
I thought that scheduling the character's update function in on_enter() could solve the problem but it does not.
The character is created after the layers, background, landscape and every other sprite.
Profiling the code proved it was pyglet's clock.py unschedule function that took 1.52sec running, but I don't really know what this means...
I guess you won't be able to help much without my code, but maybe some of you know this problem... Is it something I have to deal with ? Do you think I should create everything that rely on steady fps after some time has passed ?
Thank you very much for reading.