Files
flame/.github
Adil Hanney 521e56b6d2 feat!: Pause game when backgrounded (#2642)
When the game is backgrounded and then resumed, the update function is called with a very large dt time step.

This might cause the physics engine to hit the maximum translation per timestep, causing moving bodies to slow down to almost-zero velocities.

This PR makes the game pause if the game is backgrounded. If you'd like to change this behaviour, set the pauseWhenBackgrounded flag to true (default) or false.

class MyGame extends FlameGame {
  MyGame() {
    pauseWhenBackgrounded = false;
  }
}

This is currently not working on the web, see flutter/flutter#53107.

You can view previous discussion about this here: flame-engine/forge2d#84.
2023-09-21 16:58:52 +00:00
..
2023-03-21 07:14:11 +00:00