@Astraport What do you mean? Its a generic library, it can be used anywhere. Its used now in 2 mobile projects and one web project.
@booster Good question, the answer that you can make FPS independent simulations, but the editor is FPS dependent. The main simulation object (Emitter.as) has a step(deltaTime:Number) function, the editor calls simply step(1) in an EnterFrame handler.
This is the most simple setup and (I guess) its perfect for most users, thus the editor works this way.
If you want FPS independent simulations you can do it the following way:
1. Make a simulation in the editor using some low FPS value (for example 20). This will be a baseline where the simulation step is 1.
2. if you step your game's time adjust the dt you pass to the simulation based on the elapsed time, for example if its running currently at 40 FPS call step(0.5).
Note that values > 1 passed to the step function will make the simulation look different, in this case you have 2 options:
- Simply use the value or cap it at 1. In both cases the simulation will be a little off, but its not noticeable if your FPS just dips below 20 for a few frames rarely. If its constantly below 20, the difference will be noticeable, but I think in this case one should fix the low framerate issue.
- Call step multiple times. Say your framerate is 10, then call step(1) twice. Obviously this will incur extra CPU cost which you might not want if your FPS is low already. But on the upside your simulation is perfectly framerate independent.