My game slows down

if i die game slowly decrases frames

and console says that if i die:
[Violation] ‘requestAnimationFrame’ handler took ms
Flowlab.js?v=129:264556 [Violation] ‘requestAnimationFrame’ handler took 65ms
Flowlab.js?v=129:264556 [Violation] ‘requestAnimationFrame’ handler took 76ms
Flowlab.js?v=129:264556 [Violation] ‘requestAnimationFrame’ handler took 51ms
Flowlab.js?v=129:264556 [Violation] ‘requestAnimationFrame’ handler took 56ms
Flowlab.js?v=129:264556 [Violation] ‘requestAnimationFrame’ handler took 50ms

if i wait more this happens:
[Violation] ‘requestAnimationFrame’ handler took ms
Flowlab.js?v=129:264556 [Violation] ‘requestAnimationFrame’ handler took 1636ms
Flowlab.js?v=129:264556 [Violation] ‘requestAnimationFrame’ handler took 1512ms
Flowlab.js?v=129:264556 [Violation] ‘requestAnimationFrame’ handler took 2006ms
Flowlab.js?v=129:264556 [Violation] ‘requestAnimationFrame’ handler took 1338ms
Flowlab.js?v=129:264556 [Violation] ‘requestAnimationFrame’ handler took 1097ms
Flowlab.js?v=129:264556 [Violation] ‘requestAnimationFrame’ handler took 1206ms
Flowlab.js?v=129:264556 [Violation] ‘requestAnimationFrame’ handler took 1258ms
Flowlab.js?v=129:264556 [Violation] ‘requestAnimationFrame’ handler took 1424ms

Game: https://flowlab.io/game/view/1392958

Hey @Mainfunctestalbois - I took a quick look, and I think the problem is your “+score potion” object. It has an “Always” trigger connected to an Emitter block that is set to “Never Expire” and a Spawn. This means that:

  1. Thirty times per second the game is emitting a new Potion Trail that does not expire (and has its own behaviors)
  2. Thirty times per second the game is spawning a new Upgrade Label object

This stuff will definitely slow down your game.

grazer is fast for help #grazerthegamesaver

it worked. thx grazer!